Добрый вечер.
У меня есть проект. Он был на 2 питоне, сейчас его переделал на 3. Но сфинкс не работает...
Сфинкс инсталировался так:
pip3 install sphinx
pip3 install sphinx_bootstrap_theme
pip3 install pygments-json
pip3 install sphinxcontrib-httpdomain
Делаю make clean && make html:
(my_server_env)ubuntu@ip-172-31-13-234:~/my_server_env/my_server_repo$ . make_doc.sh
rm -rf build/*
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.3.1
making output directory...
Exception occurred:
File "<frozen importlib._bootstrap>", line 2201, in _find_and_load_unlocked
ImportError: No module named 'my_server'
The full traceback has been saved in /tmp/sphinx-err-pbk5sij9.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.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 1
(my_server_env)ubuntu@ip-172-31-13-234:~/my_server_env/my_server_repo$ cat /tmp/sphinx-err-pbk5sij9.log
# Sphinx version: 1.3.1
# Python version: 3.4.0 (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
# Loaded extensions:
Traceback (most recent call last):
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/sphinx/cmdline.py", line 244, in main
opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/sphinx/application.py", line 126, in __init__
confoverrides or {}, self.tags)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/sphinx/config.py", line 277, in __init__
execfile_(filename, config)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/sphinx/util/pycompat.py", line 128, in execfile_
exec_(code, _globals)
File "conf.py", line 32, in <module>
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/django/__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/django/conf/__init__.py", line 48, in __getattr__
self._setup(name)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/django/conf/__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "/home/ubuntu/my_server_env/lib/python3.4/site-packages/django/conf/__init__.py", line 92, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/home/ubuntu/my_server_env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2189, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2201, in _find_and_load_unlocked
ImportError: No module named 'my_server'
начало файла conf.py:
# -*- coding: utf-8 -*-
import sphinx_bootstrap_theme
import sys
import os
import shlex
def rel(*x):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
sys.path.insert(0, rel('../my_server'))
sys.path.insert(0, rel('..'))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_server.settings")
from django import setup as django_setup
django_setup()
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
Подскажите плиз что за фигня?