enter image description here

enter image description here

It checks the lib folder where my seaborn stuff is, but still error._.

Hi,
I have looked at other posts, but most seemed to be dealing with Jupyter notebooks, which I'm not. I was wondering how to get to use Seaborn in the basic Python IDE or in PyCharm. I read about filepath collisions stuff, but not too clear on that front.

I'm using Python 3.6 right now.

Thanks for any help!

6

14 Answers

When dealing with version ambiguity, remember that pip is a python module. Once you're confident that python is the python installation that your IDE is running, run

python --version python -m pip install seaborn 

>pip3 may be pointing to an old or different python installation.

2
import pip pip.main(['install','seaborn']) 

From:

If you're doing in jupyter notebook Try doing this:

!conda install -c anaconda seaborn -y 
2

Try running it in the terminal, it will work. But while running the command your pwd should be in the virtual environment in activated form

$ sudo apt-get install -y python3-seaborn 
1

Try running this in a command line 'pip install seaborn'

1

In PyCharm IDE, we can import the downloaded libraries, and that's what I did. Still, I have no clue on how to resolve this issue on Python IDE, but as of now, it's working on PyCharm for me.

Conda install seaborn worked in my case.

If you are using jupyter notebook following command will solve the issue

!pip install seaborn 

Jupyter Code-Cell:

%%bash pip install seaborn 
1

open using idle3

open using idle

Since you are using python 3, try to open with idle3 from terminal

1

Tried importing seaborn in Pycharm with the proper configuration thing, and it works. I still don't know why the regular Python IDE doesn't work even though one of the sys.path folder it checks contains the seaborn folder, but oh well.
Thanks for all the replies!

Maybe you should try “python —version “to check if you’re using the right version of python in cmd. Sometimes it happens that there are multiple versions installed and it sometimes picks the wrong one.

Also it can happens that python hasn’t the rights to use the module. Then you should create your file and run it with “python [path of file]”

Just found a new method to install all important libraries. Open command prompt: Pip install pyforest All the most important libraries got installed.

My fix (Same import error but on Jupyter Notebook). The import sequence:

import numpy as np import seaborn as sns %matplotlib inline import matplotlib.pyplot as plt 

Importing Matplotlib before seaborn can lead to an import error (I have no idea why).

The Seaborn official document also shows this:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy