How to install pandas for Python 3?

邮差的信 提交于 2019-11-29 11:06:31

问题


I try to install pandas for Python 3 by executing the following command:

sudo pip3 install pandas

As a result I get this:

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

Maybe it is interesting to note that installation for Python 2 works fine.

sudo pip install pandas

Returns the following:

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

I have just installed pandas in the following way:

sudo apt-get install python3-pandas

回答1:


Try this:

sudo apt-get install python3-pip
sudo -H pip3 install pandas



回答2:


I believe for Python 3.4 you should use: pip3 install 'pandas<0.21'. Don't forget, if your machine requires a proxy, add this bit after install: --proxy=http://sub_domain_proxy.sub_domain.domain:port




回答3:


This worked for me, finally:

pip3 install pandas --no-build-isolation



回答4:


Most of the time, pip gives me errors (I really don't know why), so I use apt-get instead.

For python3 use:

sudo apt-get install python3-pandas

For python2 use:

sudo apt-get install python-pandas


来源:https://stackoverflow.com/questions/38768996/how-to-install-pandas-for-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!