发布时间:2025-12-09 16:42:24 浏览次数:12
针对pip install 安装包下载慢的问题,主要pip install直接安装是从国外拉取安装包。
解决办法,加国内镜像,比如百度 https://mirror.baidu.com/pypi/simple
比如清华镜像:https://pypi.tuna.tsinghua.edu.cn/simple
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simplepip 之所以慢,是因为它默认使用的国外的统一的下载源,所以要想加快pip的下载速度,可行的办法就是切换下载源为国内,国内一些大公司也提供了对应的竞相网站。
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
其他类似…
将这个alias 放到 /etc/bash.bashrc 或者~/.bashrc中 以后调用pyinstall 时就可以不再加后面的参数,而且也省了 install 这个单词。