Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Colab not updating package?

I am trying to use seaborn==0.8.1 in an ipynb on Google colab. Here is my code:

"""General import statements and settings config."""
!pip install seaborn==0.8.1
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
pd.set_option('max_columns', 10)
color = sns.color_palette()[0]
print (sns.__version__)

However, this outputs the following:

Requirement already satisfied: seaborn==0.8.1 in /usr/local/lib/python3.6/dist-packages (0.8.1)
0.7.1

If the requirement is satisfied why am I importing the old version of Seaborn?

like image 697
Jay Parthasarthy Avatar asked Jul 07 '18 19:07

Jay Parthasarthy


1 Answers

The issue here is that Colab imports seaborn at startup, before you've pip install'd the new version. If you restart your runtime after the install, you'll pick up the new version.

like image 93
Craig Citro Avatar answered Sep 22 '22 06:09

Craig Citro