In Jupyter, there is an ImportError
:
import numpy as np
ImportError Traceback (most recent call last)
ipython-input-1-4ee716103900 in module()
----> 1 import numpy as np
ImportError: No mudule named numpy
But in Python, there is no error:
import numpy as np
Usually this happens because your
python
is one Python environment and whatever you're running your notebook with is another. Try runningimport sys; sys.executable
in both environments and seeing whether or not they match. If they don't, that's your problem: whateverjupyter
is running in is borrowingnumpy
from theroot
environment.