After switch to a new macbook (Mac OS Catalina), my sphinx scripts are not working anymore:
Sphinx v3.0.3 in Verwendung
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/usr/local/Cellar/sphinx-doc/3.0.3/libexec/lib/python3.8/site-packages/sphinx/config.py", line 319, in eval_config_file
execfile_(filename, namespace)
File "/usr/local/Cellar/sphinx-doc/3.0.3/libexec/lib/python3.8/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
exec(code, _globals)
File "/Applications/MAMP/htdocs/sakkadentrainer/doc/conf.py", line 43, in <module>
import sphinx_rtd_theme
ModuleNotFoundError: No module named 'sphinx_rtd_theme'
I have installed the module sphinx_rtd_theme with:
pip3 install rst2pdf
Requirement already satisfied: rst2pdf in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (0.97)
Requirement already satisfied: jinja2 in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (2.11.2)
Requirement already satisfied: pygments in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (2.6.1)
Requirement already satisfied: pdfrw in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (0.4)
Requirement already satisfied: smartypants in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (2.0.1)
Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from rst2pdf) (40.8.0)
Requirement already satisfied: docutils in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (0.16)
Requirement already satisfied: six in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from rst2pdf) (1.12.0)
Requirement already satisfied: reportlab in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from rst2pdf) (3.5.42)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from jinja2->rst2pdf) (1.1.1)
Requirement already satisfied: pillow>=4.0.0 in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (from reportlab->rst2pdf) (7.1.2)
You are using pip version 19.0.3, however version 20.2b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pip install --upgrade pip
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages/pip-20.2b1-py2.7.egg (20.2b1)
I think it has nothing to do with the sphinx_rtd_theme itself, because if I comment this theme in conf.py I get the next error:
Could not import extension rst2pdf.pdfbuilder (exception: No module named 'rst2pdf')
But if I comment all extensions the script works without error:
sphinx-build -D language=de -b html /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer_medical_doc/de/
Sphinx v3.0.3 in Verwendung
Lade Übersetzungen [de]…erledigt
loading pickled environment... failed
Fehlgeschlagen: 'str' object has no attribute '__dict__'
building [mo]: targets for 1 po files that are out of date
writing output... [100%] locale/de/LC_MESSAGES/settings_general.mo
building [html]: targets for 23 source files that are out of date
updating environment: [new config] 23 added, 0 changed, 0 removed
reading sources... [100%] train
/Applications/MAMP/htdocs/sakkadentrainer/doc/medical_product.rst:: WARNING: image file not readable: img/konferkl_signed.png
looking for now-outdated files... none found
pickling environment... erledigt
checking consistency... erledigt
preparing documents... erledigt
writing output... [100%] train
generating indices... genindexerledigt
writing additional pages... searcherledigt
copying images... [100%] img/de/train_07.png
copying static files... ... erledigt
copying extra files... erledigt
dumping search index in German (code: de)... erledigt
dumping object inventory... erledigt
build abgeschlossen, 1 warning.
The HTML pages are in ../../sakkadentrainer_medical_doc/de.
Answer from github:I think this problem is caused by your environment. Please check your python.
Sphinx is installed under /usr/local/Celler.
File "/usr/local/Cellar/sphinx-doc/3.0.3/libexec/lib/python3.8/site-packages/sphinx/config.py", line 319, in eval_config_file
But your pip3 refers /Users/beatgurtner/Library/Python.
Requirement already satisfied: rst2pdf in /Users/beatgurtner/Library/Python/3.7/lib/python/site-packages (0.97)
I guess you installed multiple pythons in your PC. Please install sphinx_rtd_theme into the Python that Sphinx installed.
My response:
Yes, I have standard python 2.7 and 3.7
python --version
Python 2.7.16
which python
/usr/bin/python
which python3
/usr/bin/python3
python3 --version
Python 3.7.3
I think for sphinx python 2.7 is enough...
So how can I tell my system and sphinx to use 2.7?
Do I have to change something in $PATH?
echo $PATH
/usr/local/opt/sphinx-doc/bin:/usr/local/opt/sphinx-doc/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Thanks for the help and sorry but for me this is all a bit of a mess ;)
python3 -m sphinx-build -D language=de -b html /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer_medical_doc/de/
/Users/beatgurtner/.pyenv/versions/3.7.1/bin/python3: No module named sphinx-build
Since the last post i tried to install pyenv to try to reduce the mess ;)
I can now switch the python --version from 2.7.16 to 3.7.1
But I'm not sure if this really helps...
If I use pyenv and use python 2.7.16 then this command should work:
sphinx-build -D language=de -b html /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer_medical_doc/de/
but I get an error:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/sphinx-doc/3.0.3/libexec/bin/python3.8
Reason: image not found
zsh: abort sphinx-build -D language=de -b html
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx...@googlegroups.com.
/usr/local/opt/python@3.8/bin/pip3 install
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/8c26b63c-132b-4cb2-965e-a1b8236bb583%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFesC-drGPj37k955jVuU5kJSdrS0UqDKoef_MM%2B-ZwJYOcU1g%40mail.gmail.com.