1
fig, axes = plt.subplots(2,figsize=(15,10))
sns.lineplot(agg_cases_death.index, agg_cases_death.cases, ax=axes[0]).set_title('Cases')
sns.lineplot(agg_cases_death.index, agg_cases_death.deaths, ax=axes[1]).set_title('Deaths')
plt.show()

The above used to work perfectly on jupyter notebook on my desktop but while I ran the same code in AWS Sagemaker Jupyter notebook it produces error. It says the module 'seaborn' has no attribute lineplot.

Is there something we need to set up while using aws sagemaker jupyter?

Kshitiz Sampang
  • 29
  • 1
  • 1
  • 12
  • If the notebook runs on your local machine, you might start with checking which version of the package you have installed and ensuring the same version is installed on the remote host. `$ pip show seaborn` will print some package details, including the version you have installed. – vulpxn May 29 '20 at 02:55

1 Answers1

2

AWS Sagemaker is, famously, utterly shit at this.

Try sns.__version__ and you will find you are running an old seaborn version.

You may be able to resolve this with:

del sns

!conda update seaborn --yes

import seaborn as sns
sns.__version__

in separate cells.

Seaborn is part of the default conda setup on a sagemaker instance, so you can't use a pip install to fix the version issue.

Mark_Anderson
  • 1,229
  • 1
  • 12
  • 34
  • I got here looking for why graphs didn't show up in Sagemaker. For others encountering the same issue, I found the fix here: https://stackoverflow.com/questions/47507830/matplotlib-plots-not-showing-on-jupyter-notebook-when-i-run-all – Russell Keane Aug 05 '22 at 11:28