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.
Related
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!
Using seaborn's documentation code to generate a lineplot returns an AttributeError: 'module' object has no attribute 'lineplot'. I have updated seaborn and reimported the module and tried again, no luck. Did lineplot get retired, or is there something else going on?
import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
fmri = sns.load_dataset("fmri")
ax = sns.lineplot(x="timepoint", y="signal", data=fmri)
If you are using conda, you need to install seaborn with the version specified:
conda install -c anaconda seaborn=0.9.0
Once your seaborn 0.9.0 is installed properly, you should be able to use the lineplot function (at least it works on mine).
That way you don't have to go outside of the conda ecosystem and use seaborn with pip.
Lineplot works with update to seaborn 0.9. conda has not yet integrated seaborn 0.9.0 into it's default channel, which is why the update to 0.9 failed on my first go.
Couldn't Update Seaborn via Default Channel but found another way to do it through this answer
As other's said before, you need seaborn version 0.9.0 (or above will work too, I guess). The pip-way of doing this without conda is:
pip install seaborn==0.9.0
My problem was that I had an older version ( 0.8.x) installed, so simply running pip install seaborn doesn't help in that case.
Alternatively, you can directly upgrade to the latest version of seaborn like this:
pip install -U seaborn
Within Jupyter notebook you can run the install without leaving the notebook.
You only have to add the tag "y" to install the package.
!conda install -y -c anaconda seaborn=0.9.0
I want to plot my bar chart by gnuplot. But I have problem with installing. I am using jupyter anaconda and the following codes don't work for installing.
!conda install gnuplot-py
!pip install gnuplot-py
!pip install gnuplot
Do you have any idea?
So first of all you need to load it as an extension
pip install gnuplot_kernel
%load_ext gnuplot_kernel
should do the job.
For further information see documentation
gplot.py
can be used in Jupyter plot function and your data/array/lists.
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