由于 Python 服务器在国外,因此使用 pip 安装第三方模块或者库的时候,下载速度特别慢,可以通过国内镜像进行下载,速度飞一般的快。
豆瓣:
https://pypi.douban.com/simple
阿里云:
https://mirrors.aliyun.com/pypi/simple
清华大学:
https://pypi.tuna.tsinghua.edu.cn/simple
中国科技大学:
https://pypi.mirrors.ustc.edu.cn/simple
使用方法为在 pip 命令后加 -i URL 方法,以从阿里云下载
pandas 库为例:
pip install pandas -i https://mirrors.aliyun.com/pypi/simple