我正在尝试使用 pip 安装 pandas。
sudo pip install pandas
我收到以下错误:
➜ ~ which python
/usr/bin/python
➜ ~ python --version
Python 2.7.10
➜ ~ sudo pip install pandas
The directory '/Users/bdisha/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/bdisha/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandas
Could not fetch URL https://pypi.python.org/simple/pandas/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Could not find a version that satisfies the requirement pandas (from versions: )
No matching distribution found for pandas
我做错了什么?
**
PS:请注意,虚拟环境中也会发生同样的情况
**
这是由于最近 Python.org 网站弃用了 TLS。
这个答案有详细信息。
总而言之,升级 pip 如下:
curl https://bootstrap.pypa.io/get-pip.py | python
然后运行:
pip install pandas
我会尝试 sudo chown -R your_user_name /Users/bdisha/Library/Caches/pip/http 和 chown -R your_user_name /Users/bdisha/Library/Caches/pip
这篇帖子可能有用
pip install -U pip
搜索了很长时间后,我尝试了这个。
pip 和 python 都是垃圾,我从来没有用 pip 安装过任何东西。避免使用 python,它是一门死语言