Google Colab not updating package?

17,400

Solution 1

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.

Solution 2

!pip install seaborn --upgrade packageName and then restart the kernel/runtime.

If you just need to upgrade seaborn in a hosted collab notebook to the latest version then run !pip install seaborn --upgrade and then restart the kernel/runtime.

Share:
17,400

Related videos on Youtube

Jay Parthasarthy
Author by

Jay Parthasarthy

Updated on October 01, 2022

Comments

  • Jay Parthasarthy
    Jay Parthasarthy over 1 year

    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?