ModuleNotFoundError: No module named 'seaborn' in Python IDE

Question:

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!

Asked By: Anon Li

||

Answers:

Try running this in a command line ‘pip install seaborn’

https://seaborn.pydata.org/installing.html#installing

Answered By: Gene Holt

open using idle3

open using idle

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

Answered By: Harshit Mehta

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.

Answered By: GiovanH

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!

Answered By: Anon Li

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]”

Answered By: Ruben

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.

Answered By: Anon Li

Jupyter Code-Cell:

%%bash

pip install seaborn
Answered By: yugansh jain

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

Answered By: yugansh jain

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

!conda install -c anaconda seaborn -y
Answered By: reddy

Conda install seaborn
worked in my case.

Answered By: Virtuall.Kingg

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
Answered By: Bhabesh Mali
import pip
pip.main(['install','seaborn'])

From: https://stackoverflow.com/a/49391839

Answered By: AISWARYA RATHEESH

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:
https://seaborn.pydata.org/installing.html

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

!pip install seaborn
Answered By: Niroshan Ratnayake

If you’re using Jupyter notebook try to run this:

pip install seaborn --user
Answered By: pasindu sandeepa
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.