I keep getting the error: ModuleNotFoundError: No module named 'seaborn'
when trying to import seaborn.
I have installed seaborn using both pip install seaborn and conda install seaborn.
I saw on seaborn that I am not the only one who has had this issue, but I have not been able to resolve this problem, how can I check and updated that my pip/conda points to the same installation as my interpreter?
EDIT:
I have tried running !pip install seaborn in the notebook, but this still does not work. I have also created my own conda env and installed seaborn (it shows base in the photos) but this also did not work.
you might have an old version of Jupyter notebook, so need to try this command to install it in the current kernel.
import sys
!{sys.executable} -m pip install seaborn
In the New Jupyter version (2019) can be installed simply as:
%pip install seaborn
Note: Answer from different question!
Related
I'm having trouble importing statsmodels into my Jupyter Notebook where I'm running Python 3.8.3
My error: ModuleNotFoundError: No module named 'statsmodels'
Things I've tried:
pip install statsmodels
conda install statsmodels
pip install git+https://github.com/statsmodels/statsmodels
This is all done in my virtual environment, which is activated in the jupyter notebook I'm attempting the import in.
I've also attempted importing using import statsmodels.api as sm, import statsmodels.robust as rb as I saw some SO posts suggesting it, but I still get the same error.
When I type !conda list on my terminal, I see statsmodels in the available packages, yet I still can't import it.
Running out of ideas here, any help is appreciated
Here my problem:
sns.scatterplot(x=[x,x,x], y=[x,x,x])
AttributeError: module 'seaborn' has no attribute 'scatterplot'
I read that seaborn needs to be updated, to solve this. So I did:
!pip install seaborn --upgrade #or also !pip install seaborn==0.9.0
import seaborn as sns
sns.__version__
0.8.1
It's not updating, and I keep getting the same AttributeError. What am I missing?
Update jupyter notebook in the Anaconda navigator. All modules will get updated. This should resolve your issue.
I just used Anaconda Prompt to update seaborn.
pip install seaborn --upgrade
and then I restarted Anaconda and it works now.
Bests,
I experienced the same issues after upgrading seaborn but it worked just fine once I restarted my kernel.
In Anaconda Navigator, I switched to running applications on tensorflow and installed jupyter 5.6.0. I then open up a Python3 notebook. I then import tensorflow, keras and numpy without issue. Then when I try to import matplotlib, the notebook says ImportError: No module named 'matplotlib'.
I tried running the following command in my anaconda prompt in both base and after activating tensorflow: pip3 install matplotlib
And it says:
(tensorflow) C:\Users\danie>pip3 install matplotlib
Requirement already satisfied
for 7 different lines. What am I doing wrong?
Add import sys and sys.executable to the top of your notebook, then run it. This shows you the directory of the running kernel. With this information, from a new command-line (not a Python console) run C:\path\to\python.exe -m pip install matplotlib
! pip install matplotlib ,worked perfect for me in the tensorflow environment (Jupyter)
I am a beginner of Python. I follow the machine learning course of Intel. And I encounter some troubles in coding. I run the code below in Jupyter and it raises an AttributeError.
import pandas as pd
step_data = [3620, 7891, 9761,3907, 4338, 5373]
step_counts = pd.Series(step_data,name='steps')
print(step_counts)
AttributeError: module 'pandas' has no attribute 'plotting'
In your terminal type
pip install plotting.
Update your pandas version using following command
pip install --upgrade pandas
If you want to execute pip command directly in Jupyter notebook, run the following:
import sys
!{sys.executable} -m pip install --upgrade pandas
The above code makes sure that the package is installed for the same version of python installed with Jupyter notebook.
In some situations the below command also works:
!pip install --upgrade pandas
Updating pandas usually corrects this error. Hence update your version of pandas and the error should be solved. Additionally, your code snippet does work.
I'm using spyder (python2.7) on a macbook for my data analysis
import seaborn as sis
but when I run:
ImportError: No module named seaboard
I installed seaborn using conda install seaborn and also pip2.7, but still having trouble in spyder. If run in terminal as python2.7 file.pyit works, so I guess I'm not able to import seaborn correctly in spyder.
PS:
I've also tried adding the right path where the package is located into python path manager.....
Thank you very much
Conda install:
http://conda.pydata.org/miniconda.html
conda install seaborn
You should use conda for easy step, or follow this tutorial:
https://stanford.edu/~mwaskom/software/seaborn/installing.html