如何升级iPython使用的软件包?

Ric*_*ard 6 python ipython pandas

我在OSX(系统上,而不是virtualenv内)上使用iPython,并将熊猫导入笔记本中。我的系统python是Python 2。

笔记本中可见的熊猫版本为0.16.2:

import pandas as pd
print pd.__version__
Run Code Online (Sandbox Code Playgroud)

我想用熊猫0.18。所以我已经退出笔记本并运行:

pip install --upgrade ipython
pip install --upgrade pandas
Run Code Online (Sandbox Code Playgroud)

这似乎安装了ipython 4.1.2和pandas 0.18.0,但是如果我运行:

ipython --version
Run Code Online (Sandbox Code Playgroud)

我看到了v4.0。运行我的笔记本仍然显示熊猫0.16.2。

如何升级软件包,以便可以在笔记本中使用熊猫0.18?

Pad*_*ham 0

pip最有可能指向python3,您可以指定具体使用什么点:

pip2 install -U ipython
pip2 install -U pandas
Run Code Online (Sandbox Code Playgroud)

另一个原因可能是安装了多个版本的 python2,因此 pip 很可能指向另一个解释器,添加which -a pipwhich -a python显示安装的内容。