我有一個名爲gaend的Google App Engine項目。我正在嘗試使用readthedocs爲其構建更好的文檔。我已經使用如何爲Google App Engine項目構建sphinx(readthedocs)文檔?
> sphinx-quickstart
建立我的基地sphinx項目。跟着
> sphinx-apidoc -o . ../gaend
生成項目的API列表。然後我運行
sphinx-autobuild . _build/html
+--------- manually triggered build ---------------------------------------------
| Running Sphinx v1.5.2
| loading pickled environment... done
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 0 source files that are out of date
| updating environment: 0 added, 1 changed, 0 removed
| reading sources... [100%] gaend
/Users/stephen/gaend/docs/gaend.rst:10: WARNING: autodoc: failed to import module u'gaend.bigquery'; the following exception was raised:
Traceback (most recent call last):
File "/Users/stephen/.virtualenvs/gaend/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 551, in import_object
__import__(self.modname)
File "/Users/stephen/gaend/gaend/bigquery.py", line 1, in <module>
from google.cloud import bigquery
ImportError: No module named google.cloud
...
ImportError: No module named google.appengine.ext
我認識到問題在於它無法訪問Google Cloud SDK。我在運行單元測試時遇到了類似的問題,並且要做到這一點的工作是runner.py。但是,這依賴於我的系統上安裝了Google Cloud SDK(安裝了Python Google App Engine模塊)。我如何在構建文檔的readthedocs服務器上獲得Google Cloud SDK(和Python GAE)?
感謝胡安,我做https://github.com/samedhi/gaend/commit/d279e0ada41c2225b23498a6bb7ddba94ae624e5。在當地工作,但當readthedocs試圖在他們的服務器上構建我的文檔時,當然會失敗......也許我缺少一個步驟或什麼? –