2

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'

Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
Abhishek kumar
  • 31
  • 1
  • 1
  • 4

2 Answers2

4

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.

Josh Friedlander
  • 10,870
  • 5
  • 35
  • 75
1

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

Sam
  • 1,264
  • 14
  • 19