xyliu00
xyliu00

Reputation: 746

Cannot import seaborn in ipython but works fine in python console

I have this wired problem on company issued windows 7 laptop.

install python 3.5 (anaconda), and other packages with conda. But I have a problem:

I cannot use seaborn in Jupyter (Ipython) notebook.

Checked if seaborn is properly installed by conda:

>conda list
...
seaborn                   0.7.0                    py35_0
...

sure enough seaborn 0.7.0 is listed

run python in terminal and import seaborn, it worked fine:

[py3] >python
Python 3.5.1 |Continuum Analytics, Inc.| ...
>>> import seaborn
>>>

run ipython in terminal, but I cannot import seaborn:

[py3] >ipython
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| .... 
In [1]: import seaborn
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-085c0287ecb5> in <module>()
----> 1 import seaborn

ImportError: No module named 'seaborn'

I have remove and then installed scipy, numpy, seaborn. But still no luck.

Any hint?

Thanks!!

Upvotes: 0

Views: 1583

Answers (2)

Chris Fonnesbeck
Chris Fonnesbeck

Reputation: 4203

I get this error, and I can confirm that it has nothing to do with having the wrong virtualenv. If I import seaborn from the ipython console, it imports without error; if I do the same from the notebook, the module cannot be found. I have confirmed that the notebook is running from the virtualenv.

Upvotes: 0

Ali Nikneshan
Ali Nikneshan

Reputation: 3502

make sure you install ipython in same virtualenv as seaborn install. Normally IPython sits in the default path and can be called even in virtualenvs it doesn't installed on them.

Upvotes: 2

Related Questions