Skip to content

Import error when installing dependencies using pip in conda #7663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ga74kud opened this issue Nov 12, 2020 · 14 comments
Closed

Import error when installing dependencies using pip in conda #7663

ga74kud opened this issue Nov 12, 2020 · 14 comments
Labels
Support Support question

Comments

@ga74kud
Copy link

ga74kud commented Nov 12, 2020

Details

Expected Result

A description of what you wanted to happen
If I build it locally it works fine. I thought if I put in the

Actual Result

on
A description of what actually happened

Running Sphinx v3.3.0

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/show-puntigam/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/show-puntigam/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/show-puntigam/checkouts/latest/docs/source/conf.py", line 3, in
import sphinxcontrib.images
ModuleNotFoundError: No module named 'sphinxcontrib.images'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/show-puntigam/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/show-puntigam/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/show-puntigam/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/show-puntigam/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/show-puntigam/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/show-puntigam/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/show-puntigam/checkouts/latest/docs/source/conf.py", line 3, in
import sphinxcontrib.images
ModuleNotFoundError: No module named 'sphinxcontrib.images'

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/show-puntigam/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/show-puntigam/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/show-puntigam/checkouts/latest/docs/source/conf.py", line 3, in
import sphinxcontrib.images

@stsewd
Copy link
Member

stsewd commented Nov 12, 2020

Hi, the error is

ModuleNotFoundError: No module named 'sphinxcontrib.images'

That means you are missing installing some dependencies from your project, please check https://docs.readthedocs.io/en/stable/guides/specifying-dependencies.html

@stsewd stsewd added Needed: more information A reply from issue author is required Support Support question labels Nov 12, 2020
@swaldhoer
Copy link

I have the same issue. I install all deps (and the log shows, that all deps are getting installed. Nevertheless RTD then says that the module is missing.

conda env create --quiet --name minor-cleanup --file environment.yml

Collecting package metadata: ...working... done Solving environment: ...working... done Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... done Ran pip subprocess with arguments: [u'/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/docs/checkouts/readthedocs.org/user_builds/native-lua/checkouts/minor-cleanup/tmpMoKzXX.requirements.txt'] Pip subprocess output: Collecting black>=19.10b0 Downloading black-20.8b1.tar.gz (1.1 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'done' Collecting pylint>=2.5.0 Downloading pylint-2.6.0-py3-none-any.whl (325 kB) Collecting setuptools Using cached setuptools-50.3.2-py3-none-any.whl (785 kB) Collecting Sphinx>=3.2.0 Downloading Sphinx-3.3.1-py3-none-any.whl (2.9 MB) Collecting sphinx-copybutton>=0.3.0 Downloading sphinx_copybutton-0.3.1-py3-none-any.whl (10 kB) Collecting sphinx-rtd-theme>=0.5.0 Downloading sphinx_rtd_theme-0.5.0-py2.py3-none-any.whl (10.8 MB) Collecting sphinxcontrib-platformpicker>=1.1 Downloading sphinxcontrib_platformpicker-1.1-py3-none-any.whl (5.4 kB) Collecting toml Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB) Requirement already up-to-date: wheel in /home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.9/site-packages (from -r file:requirements.txt (line 9)) (0.35.1) Collecting pathspec<1,>=0.6 Downloading pathspec-0.8.1-py2.py3-none-any.whl (28 kB) Collecting appdirs Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting typing-extensions>=3.7.4 Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB) Collecting mypy-extensions>=0.4.3 Downloading mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB) Collecting click>=7.1.2 Downloading click-7.1.2-py2.py3-none-any.whl (82 kB) Collecting regex>=2020.1.8 Downloading regex-2020.11.13-cp39-cp39-manylinux2014_x86_64.whl (732 kB) Collecting typed-ast>=1.4.0 Downloading typed_ast-1.4.1-cp39-cp39-manylinux1_x86_64.whl (769 kB) Collecting astroid<=2.5,>=2.4.0 Downloading astroid-2.4.2-py3-none-any.whl (213 kB) Collecting isort<6,>=4.2.5 Downloading isort-5.6.4-py3-none-any.whl (98 kB) Collecting mccabe<0.7,>=0.6 Downloading mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB) Collecting sphinxcontrib-qthelp Downloading sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB) Collecting Jinja2>=2.3 Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB) Collecting imagesize Downloading imagesize-1.2.0-py2.py3-none-any.whl (4.8 kB) Collecting sphinxcontrib-applehelp Downloading sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl (121 kB) Collecting docutils>=0.12 Downloading docutils-0.16-py2.py3-none-any.whl (548 kB) Collecting Pygments>=2.0 Downloading Pygments-2.7.2-py3-none-any.whl (948 kB) Collecting sphinxcontrib-devhelp Downloading sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB) Collecting sphinxcontrib-jsmath Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB) Collecting snowballstemmer>=1.1 Downloading snowballstemmer-2.0.0-py2.py3-none-any.whl (97 kB) Collecting alabaster<0.8,>=0.7 Downloading alabaster-0.7.12-py2.py3-none-any.whl (14 kB) Collecting requests>=2.5.0 Downloading requests-2.25.0-py2.py3-none-any.whl (61 kB) Collecting packaging Downloading packaging-20.4-py2.py3-none-any.whl (37 kB) Collecting sphinxcontrib-serializinghtml Downloading sphinxcontrib_serializinghtml-1.1.4-py2.py3-none-any.whl (89 kB) Collecting sphinxcontrib-htmlhelp Downloading sphinxcontrib_htmlhelp-1.0.3-py2.py3-none-any.whl (96 kB) Collecting babel>=1.3 Downloading Babel-2.9.0-py2.py3-none-any.whl (8.8 MB) Collecting wrapt~=1.11 Downloading wrapt-1.12.1.tar.gz (27 kB) Collecting lazy-object-proxy==1.4.* Downloading lazy-object-proxy-1.4.3.tar.gz (34 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'done' Collecting six~=1.12 Downloading six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting MarkupSafe>=0.23 Downloading MarkupSafe-1.1.1.tar.gz (19 kB) Collecting chardet<4,>=3.0.2 Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB) Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.9/site-packages (from requests>=2.5.0->Sphinx>=3.2.0->-r file:requirements.txt (line 4)) (2020.11.8) Collecting idna<3,>=2.5 Downloading idna-2.10-py2.py3-none-any.whl (58 kB) Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB) Collecting pyparsing>=2.0.2 Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB) Collecting pytz>=2015.7 Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB) Building wheels for collected packages: black, wrapt, lazy-object-proxy, MarkupSafe Building wheel for black (PEP 517): started Building wheel for black (PEP 517): finished with status 'done' Created wheel for black: filename=black-20.8b1-py3-none-any.whl size=124186 sha256=7a1700b8c4890f1f9e87579f7a25f21d5d127c1f93655325c4631bc2f65adbde Stored in directory: /home/docs/.cache/pip/wheels/4e/57/9a/e704bdd859ee892dc46fff03fd499422dc9e99fd9bd5c446d3 Building wheel for wrapt (setup.py): started Building wheel for wrapt (setup.py): finished with status 'done' Created wheel for wrapt: filename=wrapt-1.12.1-cp39-cp39-linux_x86_64.whl size=36925 sha256=252a04272492470d8993f8fb1fa7750e43a3f0254013a5dc766d8a2d4d96cb66 Stored in directory: /home/docs/.cache/pip/wheels/98/23/68/efe259aaca055e93b08e74fbe512819c69a2155c11ba3c0f10 Building wheel for lazy-object-proxy (PEP 517): started Building wheel for lazy-object-proxy (PEP 517): finished with status 'done' Created wheel for lazy-object-proxy: filename=lazy_object_proxy-1.4.3-cp39-cp39-linux_x86_64.whl size=20956 sha256=9215369624c62972f5d7cd0507249767e1a56d7c75a639cb29e4c9e1b9fe1860 Stored in directory: /home/docs/.cache/pip/wheels/41/20/07/2a3e02cdfc8b442404202f6ef99ff1b1c16b73910968a46f2f Building wheel for MarkupSafe (setup.py): started Building wheel for MarkupSafe (setup.py): finished with status 'done' Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-cp39-cp39-linux_x86_64.whl size=17728 sha256=aa7270205b8efcf7e87aae49135033ac1128fcddac6dbe67a32a2812a09395d4 Stored in directory: /home/docs/.cache/pip/wheels/e0/19/6f/6ba857621f50dc08e084312746ed3ebc14211ba30037d5e44e Successfully built black wrapt lazy-object-proxy MarkupSafe Installing collected packages: toml, pathspec, appdirs, typing-extensions, mypy-extensions, click, regex, typed-ast, black, wrapt, lazy-object-proxy, six, astroid, isort, mccabe, pylint, setuptools, sphinxcontrib-qthelp, MarkupSafe, Jinja2, imagesize, sphinxcontrib-applehelp, docutils, Pygments, sphinxcontrib-devhelp, sphinxcontrib-jsmath, snowballstemmer, alabaster, chardet, idna, urllib3, requests, pyparsing, packaging, sphinxcontrib-serializinghtml, sphinxcontrib-htmlhelp, pytz, babel, Sphinx, sphinx-copybutton, sphinx-rtd-theme, sphinxcontrib-platformpicker Attempting uninstall: setuptools Found existing installation: setuptools 49.6.0.post20201009 Uninstalling setuptools-49.6.0.post20201009: Successfully uninstalled setuptools-49.6.0.post20201009 Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 Pygments-2.7.2 Sphinx-3.3.1 alabaster-0.7.12 appdirs-1.4.4 astroid-2.4.2 babel-2.9.0 black-20.8b1 chardet-3.0.4 click-7.1.2 docutils-0.16 idna-2.10 imagesize-1.2.0 isort-5.6.4 lazy-object-proxy-1.4.3 mccabe-0.6.1 mypy-extensions-0.4.3 packaging-20.4 pathspec-0.8.1 pylint-2.6.0 pyparsing-2.4.7 pytz-2020.4 regex-2020.11.13 requests-2.25.0 setuptools-50.3.2 six-1.15.0 snowballstemmer-2.0.0 sphinx-copybutton-0.3.1 sphinx-rtd-theme-0.5.0 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-1.0.3 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-platformpicker-1.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.4 toml-0.10.2 typed-ast-1.4.1 typing-extensions-3.7.4.3 urllib3-1.26.2 wrapt-1.12.1

To activate this environment, use:

> conda activate minor-cleanup

To deactivate an active environment, use:

> conda deactivate

python /home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/bin/sphinx-build -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html

Running Sphinx v3.2.1 loading translations [en]... done

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/site-packages/sphinx/registry.py", line 409, in load_extension
mod = import_module(extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'sphinx_copybutton'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/site-packages/sphinx/application.py", line 244, in init
self.setup_extension(extension)
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/site-packages/sphinx/application.py", line 398, in setup_extension
self.registry.load_extension(self, extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/native-lua/conda/minor-cleanup/lib/python3.8/site-packages/sphinx/registry.py", line 412, in load_extension
raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension sphinx_copybutton (exception: No module named 'sphinx_copybutton')

Extension error:
Could not import extension sphinx_copybutton (exception: No module named 'sphinx_copybutton')

Link: https://readthedocs.org/projects/native-lua/builds/12342066/

@aaronmarkham
Copy link

For my similar issue, I'm concerned that if I want to use the latest nbsphinx package on pypi, I can't. I am forced to use what is in conda, which is older. (My workaround to get the module installed was to move the pip dependencies in my environment.yml file to conda.)

@no-response
Copy link

no-response bot commented Nov 26, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

@no-response no-response bot closed this as completed Nov 26, 2020
@stsewd stsewd reopened this Nov 26, 2020
@stsewd
Copy link
Member

stsewd commented Nov 26, 2020

I'm re-opening since it looks like other users are having the same problem.

@no-response
Copy link

no-response bot commented Nov 26, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

@no-response no-response bot closed this as completed Nov 26, 2020
@stsewd stsewd reopened this Nov 26, 2020
@no-response
Copy link

no-response bot commented Nov 26, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

@no-response no-response bot closed this as completed Nov 26, 2020
@stsewd stsewd removed the Needed: more information A reply from issue author is required label Nov 26, 2020
@stsewd
Copy link
Member

stsewd commented Nov 26, 2020

Come on bot!

@swaldhoer
Copy link

@stsewd are there any updates on this?

@stsewd
Copy link
Member

stsewd commented Dec 7, 2020

Sorry, I haven't had time to look into this

@swaldhoer
Copy link

Ok thanks. If you need some additional info i'd be happy to help.

@stsewd
Copy link
Member

stsewd commented Dec 17, 2020

Builds from the original reported project are passing https://readthedocs.org/projects/show-puntigam/builds/ looks like installing the requirements was missing.

The other project solved this with aws/amazon-sagemaker-examples@f3b8d93#diff-9efd195f4e9bfb79ccd456a1d8370fafcc4bcb0b00ea3799222667d2ae818533 I think maybe the conda version or something weird on how it installs packages via pip?

Changing the title as this is for conda when using the pip key.

@stsewd stsewd changed the title build failed -> importing extension produces error Import error when installing dependencies using pip in conda Dec 17, 2020
@stsewd
Copy link
Member

stsewd commented Dec 17, 2020

Looks like a bug in a version of conda, I have enabled a flag to upgrade conda at the beginning and now your project is working https://readthedocs.org/projects/native-lua/builds/12587731/

If anyone else is having this problem, please email us at support to ask to enable that flag for your project

@stsewd stsewd closed this as completed Dec 17, 2020
@swaldhoer
Copy link

swaldhoer commented Dec 17, 2020

Thanks for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

4 participants