Python替换pypi阿里源

安装python解释器完成后,使用pip安装模块会遇到超时或者直接无法安装,可以设置使用国内的阿里源或者清华源,下面介绍下步骤
阿里源:pypi镜像源
清华源:pypi镜像源
python -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
python -m pip config set install.trusted-host mirrors.aliyun.com
windows:

C:\Users
$ python -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
Writing to C:\Users\xxx\AppData\Roaming\pip\pip.ini
C:\Users
$ python -m pip config set install.trusted-host mirrors.aliyun.com
Writing to C:\Users\xxx\AppData\Roaming\pip\pip.ini

linux:

root@ubuntu:~# python -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
Writing to /root/.config/pip/pip.conf
root@ubuntu:~# python -m pip config set install.trusted-host mirrors.aliyun.com
Writing to /root/.config/pip/pip.conf
posted @   Henry-0316  阅读(462)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
点击右上角即可分享
微信分享提示