更换Python版本后easy_install和pip报错
from pkg_resources import load_entry_point
可使用命令修复:
# Linux
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
# MacOS
curl https://bootstrap.pypa.io/ez_setup.py | sudo python
参考:https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources
pip镜像源配置
Linux中pip镜像源配置文件位置有:
# 系统配置
/etc/pip.conf
# 账户配置
~/.pip/pip.conf
# 不详
~/.config/pip/pip.conf
在其中添加
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com