Reputation: 27
I'm having trouble importing modules into Jupyter notebook. The sys.path is wrong and I don't know how to repair it.
From Jupyter sys.executable
runs:
'/usr/----/opt/python/bin/python2.7'
From the command line it runs:
'/Users/----/miniconda2/bin/python'
so when I try running import MySQLdb
, I get the following error:
---------------------------------------------------------------------------
ImportError
Traceback (most recent call last)
<ipython-input-10-dd22983d5391> in <module>()
----> 1 import MySQLdb
ImportError: No module named MySQLdb
However, within my command line my import module works fine. How do i remedy this? Thanks
Upvotes: 0
Views: 636
Reputation: 819
install the module sudo pip install mysql-python
else,
You should try conda install ipykernel --name Python
, python -m ipykernel install
. Then it wil fix the notebook it will be seeing your Python kernel. Then create a new >Python notebook
Upvotes: 0