2
votes

I having trouble running relplot function in colab notebook but it works fine in jupyter notebook.

Getting the following error in colab


AttributeError Traceback (most recent call last) in () ----> 1 sns.relplot(x="total_bill", y="tip", 2 col="time", # Categorical variables that will determine the faceting of the grid. 3 hue="smoker", # Grouping variable that will produce elements with different colors. 4 style="smoker", # Grouping variable that will produce elements with different styles. 5 size="size", # Grouping variable that will produce elements with different sizes.

AttributeError: module 'seaborn' has no attribute 'relplot'

2
You're using an older version of seaborn. Try upgrading to the latest.pault

2 Answers

4
votes

You're getting this error because this is a plot available only in the newest version of Seaborn (0.9), as documented here. Try upgrading through pip3 install seaborn==0.9.0. If that doesn't work, it's possible Colab isn't integrated with this version.

1
votes

Change directory to where pip3.exe is located:
for me: cd C:\Users\sam\AppData\Local\Programs\Python\Python37-32\Scripts

use .\
.\pip3 install seaborn==0.9.0