ModuleNotFoundError: No module named 'seaborn' in Python IDE
Question:
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!
Answers:
Try running this in a command line ‘pip install seaborn’
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.
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]”
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.
Jupyter Code-Cell:
%%bash
pip install seaborn
Just found a new method to install all important libraries.
Open command prompt:
Pip install pyforest
All the most important libraries got installed.
If you’re doing in jupyter notebook Try doing this:
!conda install -c anaconda seaborn -y
Conda install seaborn
worked in my case.
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
import pip
pip.main(['install','seaborn'])
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
If you’re using Jupyter notebook try to run this:
pip install seaborn --user
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!
Try running this in a command line ‘pip install seaborn’
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.
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]”
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.
Jupyter Code-Cell:
%%bash
pip install seaborn
Just found a new method to install all important libraries.
Open command prompt:
Pip install pyforest
All the most important libraries got installed.
If you’re doing in jupyter notebook Try doing this:
!conda install -c anaconda seaborn -y
Conda install seaborn
worked in my case.
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
import pip
pip.main(['install','seaborn'])
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
If you’re using Jupyter notebook try to run this:
pip install seaborn --user