s-monie
s-monie

Reputation: 241

Seaborn Lineplot Module Object Has No Attribute 'Lineplot'

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)

Upvotes: 19

Views: 43775

Answers (4)

stefanbschneider
stefanbschneider

Reputation: 6086

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

Upvotes: 3

Stryker
Stryker

Reputation: 6120

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

Upvotes: 1

Anthony Lei
Anthony Lei

Reputation: 241

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.

Upvotes: 11

s-monie
s-monie

Reputation: 241

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

Upvotes: 4

Related Questions