私はsphinxのドキュメントとドキュメントをリンクしようとしています。私は次のエラーを取得するドキュメントを生成自動的にドキュメントを読んだしようとすると、ローカルのドキュメントを構築することができますが、:Readthedocsの私のコードのためのImportError
スフィンクス標準エラーを
Making output directory...
Exception occurred:
File "/var/build/user_builds/mousedb/checkouts/latest/Docs/source/conf.py", line 25, in <module>
from mousedb import settings
ImportError: No module named mousedb
The full traceback has been saved in /tmp/sphinx-err-n_8fkR.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
私のプロジェクト名はmousedbです。私はなぜ私が自動ビルドでこのインポートエラーを取得するが、ローカルではない理解していない。私は、これは兄弟Docsディレクトリにファイルを自分の設定をインポートするための課題であると考えてコメントに基づいて
更新
。 (私が行っていたように)absolute importを行うのではなく、settings.pyとconf.pyの場所に基づいて相対インポートを行うべきです。
設定ファイルを私のconf.pyにインポートしたい
-mousedb
--settings.py
-Docs
--source
---conf.py
--build
rtd設定で 'Use virtualenv'チェックボックスを設定しようとしましたか? setup.py install –
を使ってvirtualenvの中にプロジェクトをインストールしました。同じエラーが表示されました。絶対パスではなく、sys.path.appendで相対パスを使用する必要がありますか(ローカルインストールの場合) – Dave
ローカル絶対パスは、readthedocsのサーバーにはほとんど存在しないことが保証されています。 ) –