如何为Python 3安装pandas?

时间:2016-08-04 13:39:36

标签: python pandas install pip python-3.4

我尝试通过执行以下命令为Python 3安装pandas:

sudo pip3 install pandas

结果我得到了这个:

Downloading/unpacking pandas
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pandas
Cleaning up...
No distributions at all found for pandas

可能有趣的是,Python 2的安装工作正常。

sudo pip install pandas

返回以下内容:

Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/lib/python2.7/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/lib/python2.7/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in /usr/lib/python2.7/dist-packages (from pandas)
Cleaning up...

ADDED

我刚刚以下列方式安装了pandas:

sudo apt-get install python3-pandas

4 个答案:

答案 0 :(得分:8)

试试这个:

sudo apt-get install python3-pip

sudo -H pip3 install pandas

答案 1 :(得分:4)

我相信Python 3.4你应该使用:pip3 install 'pandas<0.21'。 不要忘记,如果您的机器需要代理,请在安装后添加此位:--proxy=http://sub_domain_proxy.sub_domain.domain:port

答案 2 :(得分:1)

这最终对我有用,

pip3 install pandas --no-build-isolation

由于

答案 3 :(得分:1)

大多数时候,点子工具会给我带来很多错误(我真的不知道为什么)。 所以我大多数时候都使用apt-get。

对于python3使用:

sudo apt-get install python3-pandas

对于python2使用:

sudo apt-get install python-pandas