Skip to content Skip to sidebar Skip to footer

Python - Can't Import Seaborn

I'm running iPhyton Notebooks and I'm trying to import the Seaborn package. When I try to import it from the Terminal, it loads up fine, but when I import it through iPython Notebo

Solution 1:

Try this

import sys
print sys.path
sys.path.append('<path to package in your syste>')

import seaborn

In my Ubuntu 14.4LTS the packages get installed in the following folder

/usr/local/lib/python2.7/dist-packages

So I simply add the package path at run time

Solution 2:

Donit install Ipython on all your system. Install it only in the environments you want it. Otherwise Ipython will look for modules in the default path instead of the environment's path.

This is probably where your ipython is looking:

/home/user/anaconda2/lib/python2.7/

It should be looking for modules here:

/home/user/anaconda2/envs/name-of-env/lib/python3.4/

To check the path you type:

import sys
sys.path

Solution 3:

Try entering the following in your terminal:

conda install seaborn

It will install seaborn and make it available for you to import into your notebook

Solution 4:

Open anaconda prompt and Type

pip install seaborn

Post a Comment for "Python - Can't Import Seaborn"