When doing imports in conf.py
, I got complaints from autodoc when running sphinx-build source/ build/
:
WARNING: autodoc: failed to import module '<my_module>' from module '<my_project>'; the following exception was raised: No module named 'pandas'
Note that unlike in many SO questions referring to this kind of error, the problem here is not my own project/module which is found! Instead the pandas dependency isn't.
I made sure the Python version I used to install sphinx (Python 3.8.6) has pandas installed and added print(sys.version)
to the conf.py
file to discover that sphinx actually uses a different version (3.8.2)!
What's more I never actively installed version 3.8.2 (I have 3.8.5 and 3.8.6 through brew and 3.8.6 through pyenv)
When running make html
instead the correct Python version is used.
So what is the issue with the sphinx-build
?