readthedocs.org: `ModuleNotFoundError: No module named 'six'` on build
Details
I tried building my docs for my project, yet this fails with a ModuleNotFoundError
Expected Result
A successful build
Actual Result
The following error:
Running Sphinx v3.3.1
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 319, in eval_config_file
execfile_(filename, namespace)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
exec(code, _globals)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/checkouts/latest/docs/source/conf.py", line 82, in <module>
from six import string_types
ModuleNotFoundError: No module named 'six'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 219, in __init__
self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 174, in read
namespace = eval_config_file(filename, tags)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 332, in eval_config_file
raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 319, in eval_config_file
execfile_(filename, namespace)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
exec(code, _globals)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/checkouts/latest/docs/source/conf.py", line 82, in <module>
from six import string_types
ModuleNotFoundError: No module named 'six'
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 319, in eval_config_file
execfile_(filename, namespace)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/envs/latest/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
exec(code, _globals)
File "/home/docs/checkouts/readthedocs.org/user_builds/dblstats/checkouts/latest/docs/source/conf.py", line 82, in <module>
from six import string_types
ModuleNotFoundError: No module named 'six'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 15 (6 by maintainers)
Commits related to this issue
- added six to reqs (recent problem: https://github.com/readthedocs/readthedocs.org/issues/7705) — committed to yaroslaff/okerrupdate-doc by yaroslaff 4 years ago
Hi, I had the same issue. At first, I followed the recommendation https://github.com/readthedocs/readthedocs.org/issues/7704#issuecomment-735030431 but it was not complete without specifying requirements in the settings.
Solved
Here is how I solved it, first follow https://github.com/readthedocs/readthedocs.org/issues/7704#issuecomment-735030431, and then click Admin, Advanced Settings and then under the section Requirements file add the file path you created docs/requirements.txt. Click on Save and build Version. I hope this works out for you.
Cheers.
Hi all! I deployed a quick fix for now that does not install latest
sphinx
version by default (3.3.1) but the previous one that Read the Docs pinned for years (1.8.x).We enabled this feature (
USE_LATEST_SPHINX
for new projects) to start testing the builder with this new version of Sphinx, but we didn’t realize thatsix
was not a dependency anymore. So, for now, I disabled this feature and your builds will usesphinx==1.8.x
by default. If you want to use a different version of Sphinx, please specify it in yourrequirements.txt
file as usual.We will have a fix for this soon and we will re-enable
USE_LATEST_SPHINX
version for new projects.