美文网首页
Python 更改 pip 源至国内镜像

Python 更改 pip 源至国内镜像

作者: 左诗右码 | 来源:发表于2023-11-06 17:25 被阅读0次

Windows 或 Linux 更改 pip 源至国内镜像

Linux:


mkdir ~/.pip
cat > ~/.pip/pip.conf << EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/
EOF

或者下载安装包的时候直接接源信息:


pip3 install aiohttp==3.6.2 -i https://pypi.douban.com/simple/

Windows:

首先在 window 的文件夹窗口输入 : %APPDATA%
然后创建 pip 文件夹
最后创建 pip.ini 文件,写入如下内容


[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

相关文章

网友评论

      本文标题:Python 更改 pip 源至国内镜像

      本文链接:https://www.haomeiwen.com/subject/aphxwdtx.html