Skip to content
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

No module named 'nbsphinx' #7665

Closed
aaronmarkham opened this issue Nov 14, 2020 · 10 comments
Closed

No module named 'nbsphinx' #7665

aaronmarkham opened this issue Nov 14, 2020 · 10 comments

Comments

@aaronmarkham
Copy link

Details

Expected Result

A successful build using nbsphinx.
This worked 3 weeks ago on a different branch, but I just merged to master and the new build didn't work.

Actual Result

Collecting nbsphinx==0.7.1
  Downloading nbsphinx-0.7.1-py3-none-any.whl (24 kB)

So it gets the module when preparing the container...
But when Sphinx is running later it gets this error:
Could not import extension nbsphinx (exception: No module named 'nbsphinx')

This points to my environment file:
https://github.com/aws/amazon-sagemaker-examples/blob/website/.readthedocs.yml

Which is here:
https://github.com/aws/amazon-sagemaker-examples/blob/website/environment.yml#L3
Where I specify nbsphinx

@aaronmarkham
Copy link
Author

I reran the build using the old branch that was working before and that also failed.
I can run the build locally with either branch, and it works fine.

@aaronmarkham
Copy link
Author

I moved nbsphinx into the conda dependencies instead of pip and the build worked. I also have sphinx pinned to an earlier version, but it isn't respecting that... it is using 3.2.1 instead of what I have in there - 3.1.1.

I think this is a bug.

@swaldhoer
Copy link

swaldhoer commented Nov 15, 2020

This is a little bit like #7663. However, as mentioned in my comment #7663, I use conda instead of pip and it does not help.

@aaronmarkham
Copy link
Author

This is a little bit like #7663. However, as mentioned in my comment #7663, I use conda instead of pip and it does not help.

I looked at your build logs and it is the same behavior. You have sphinx_copybutton in your environment and it installs it, but then it isn't found later in the pipeline. It's like it builds the env, but then uses something else.

@swaldhoer
Copy link

Then it would good to know why using conda solved your problem, bur not mine. Maybe I dig into this sometimes on the weekend.

@stsewd
Copy link
Member

stsewd commented Nov 16, 2020

I moved nbsphinx into the conda dependencies instead of pip and the build worked. I also have sphinx pinned to an earlier version, but it isn't respecting that... it is using 3.2.1 instead of what I have in there - 3.1.1.

@aaronmarkham see #3829 for that problem.

@stsewd stsewd closed this as completed Nov 16, 2020
@stsewd
Copy link
Member

stsewd commented Nov 16, 2020

I'll keep open the other issue to track the other problem with the import error

@aaronmarkham
Copy link
Author

I'll keep open the other issue to track the other problem with the import error

The core issue I had was the pip problem - it was installing nbsphinx and not finding it later. I don't know why moving nbsphinx to conda would work, but it did. This isn't a viable solution for everyone or every dependency though. I'm concerned that there is still a bug here, and if I require a pip package that's not on conda too, I'll be stuck.

3829 explains why it didn't load v3.1.1 of Sphinx though... this is more of an annoyance... the pip problem is kind of a big deal.

@stsewd
Copy link
Member

stsewd commented Nov 17, 2020

I was referring to #7663

@NEGU93
Copy link

NEGU93 commented Jan 9, 2021

In case it works for someone... I also had this problem and I installed everything with conda. I fixed it by updating sphinx.
sphinx 3.1.2-py_0 --> 3.4.3-pyhd3eb1b0_0
My nbsphinx version was: nbsphinx conda-forge/noarch::nbsphinx-0.8.0-pyhd3deb0d_0

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

No branches or pull requests

4 participants