Python pandas 停留在 0.7.0 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17759128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python pandas stuck at version 0.7.0
提问by James Haskell
First off, I'm a novice... I'm a newbie to Python, pandas, and Linux.
首先,我是新手……我是 Python、pandas 和 Linux 的新手。
I'm getting some errors when trying to populate a DataFrame (sql.read_frame() gives an exception when trying to read from my MySQL DB, but I am able to execute and fetch a query / stored proc). I noticed that pandas is at version 0.7.0, and running "sudo apt-get install python-pandas" just says that it's up to date (no errors): "... python-pandas is already the newest version. 0 upgraded..."
尝试填充 DataFrame 时出现一些错误(sql.read_frame() 在尝试从我的 MySQL 数据库中读取时出现异常,但我能够执行和获取查询/存储过程)。我注意到pandas的版本是0.7.0,运行“sudo apt-get install python-pandas”只是说它是最新的(没有错误):“... python-pandas已经是最新版本。0升级……”
Based on some other posts I found on the web, I think my DataFrame problem may be due to the older version of pandas (something about a pandas bug involving tuples of tuples?). Why won't pandas update to a more current version?
根据我在网上找到的其他一些帖子,我认为我的 DataFrame 问题可能是由于旧版本的 Pandas(关于 Pandas 错误涉及元组元组?)。为什么大Pandas不会更新到更新的版本?
Setup:
设置:
Ubuntu: 12.04.2 LTS Desktop (virtual workstation on VMWare)
sudo apt-get update, sudo apt-get upgrade, and sudo apt-get dist-upgrade all current
Python: 2.7.3 (default, April 10 2013, 06:20:15) /n [GCC 4.6.3] on Linux2
$ "which python" only show a single instance: /usr/bin/python
pandas.__version__ = 0.7.0
numpy.__version__ = 1.6.1
I tried installing Anaconda previously, but that turned into a big nightmare, with conflicting versions of Python. I finally rolled back to previous VM snapshot and started over, installing all of the MySQL, pandas, and iPython using apt-get on the individual packages.
我之前尝试过安装 Anaconda,但这变成了一场大噩梦,因为 Python 版本相互冲突。我终于回滚到以前的 VM 快照并重新开始,使用 apt-get 在各个包上安装所有 MySQL、pandas 和 iPython。
I'm not having any other problems on this workstation... apt-get seems to be working fine in general, and all other apps (MySQL Workbench, Kettle / spoon, etc.) are all working properly and up to date.
我在这个工作站上没有任何其他问题... apt-get 似乎总体上运行良好,并且所有其他应用程序(MySQL Workbench、Kettle/spoon 等)都正常运行并且是最新的。
Any ideas why Python pandas won't upgrade to 0.11.0? Thank you.
为什么 Python pandas 不会升级到 0.11.0 的任何想法?谢谢你。
回答by Kyle Kelley
As nitin points out, you can simply upgrade pandas using pip:
正如 nitin 指出的,您可以简单地使用 pip 升级 Pandas:
pip install --upgrade pandas
Since this version of pandas will be installed in site-packagesyou will, in fact, be at the mercy of any automatic updates to packages within that directory. It's wise to install the versions of packages you want into a virtual environmentso you have a consistent working environment with the bonus of reproducibility.
由于此版本的 pandas 将安装在site-packages您中,实际上,您将受到对该目录中软件包的任何自动更新的支配。明智的做法是将您想要的软件包版本安装到虚拟环境中,这样您就有了一致的工作环境和可重复性的好处。
To answer your last question, the reason Pandas won't "upgrade" to 0.11.0 using apt-get updateis that packages (of Pandas) from your distribution lag behind or haven't been created yet.
为了回答您的最后一个问题,Pandas 不会使用“升级”到 0.11.0 的原因apt-get update是您的发行版中的包(Pandas)滞后或尚未创建。
回答by user3062149
"pip install --upgrade pandas" did not work for me on a fresh Ubuntu: 12.04.2 LTS Desktop instance. Within Python, pandas was still showing version 0.7.0.
“pip install --upgrade pandas”在全新的 Ubuntu: 12.04.2 LTS 桌面实例上对我不起作用。在 Python 中,pandas 仍然显示版本 0.7.0。
Instead, I was able to get the update through by using easy install:
相反,我能够通过使用简单安装来获得更新:
sudo easy_install -U pandas
回答by nitin
Try upgrading with pip, like so
尝试使用 pip 升级,就像这样
pip install --upgrade pandas

