问题描述
我在 Ubuntu 14 上使用预装的 python3.4,并且想将 pandas 升级到 0.18.0 版本:
I use the pre-installed python3.4 on Ubuntu 14 and want to upgrade pandas to version 0.18.0:
import pandas
pandas.__version__
>>>>'0.13.1'
当我尝试时,他似乎没有升级任何东西
When I try that it seems that he does not upgrade anything
sudo apt-get install --only-upgrade python-pandas
python-pandas is already the newest version.
The following packages were automatically installed and are no longer required:
kde-l10n-de kde-l10n-engb
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
并且我在升级函数调用后仍然有相同的版本:
and I still have the same version after the upgrade function call:
import pandas
pandas.__version__
'0.13.1'
我的错误在哪里?谢谢!
Where is my mistake? Thanks!
然后我尝试使用
pip3 install --upgrade pandas
并收到此错误消息:
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_server/pandas/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ts_7va4h-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_server/pandas
Storing debug log for failure in /home/server/.pip/pip.log
当我使用
sudo pip3 install --upgrade pandas
没有错误信息,但也没有升级.
there is no error message but there is also nothing upgraded.
似乎需要计算机科学博士学位才能安装 python 3 软件包.
It seems one needs a PhD in computer science to get a python 3 package installed.
推荐答案
我遇到了同样的问题(无法通过 pip3 更新 pandas).问题是从两个来源(pip3 和 apt-get)安装熊猫.试试这个(这是我在 ubuntu 16.04 上所做的):
I had this same issue (not being able to update pandas via pip3). The problem is installing pandas from two sources (pip3 and apt-get). Try this (it's what I did on ubuntu 16.04):
- 删除现有的熊猫:
sudo apt-get 删除 python3-pandas
sudo pip3 install pandas # 安装了pandas 0.18
检查终端 (ctr+alt+t) 类型的正确版本:
Check the correct version a terminal (ctr+alt+t) type:
pip3 list # 打印出已安装的python3模块列表
OR/AND
python3
导入熊猫
pandas.__version__
这篇关于Python3.4:升级 pandas 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!