Google Colab无法更新软件包吗? [英] Google Colab not updating package?

查看:185
本文介绍了Google Colab无法更新软件包吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google colab的ipynb中使用seaborn == 0.8.1.这是我的代码:

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

如果满足要求,为什么要导入旧版本的Seaborn?

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

推荐答案

此处的问题是,在pip install创建新版本之前,Colab在启动时会导入seaborn.如果在安装后重新启动运行时,则会选择新版本.

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.

这篇关于Google Colab无法更新软件包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆