Python 配置镜像源

Python 配置镜像源

1. 查看当前源

pip config get global.index-url

2. 临时变更源

pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

3. 永久变更源

清华(推荐速度最快)

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

百度

pip config set global.index-url https://mirror.baidu.com/pypi/simple

腾讯

pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

中国科学技术大学开源软件镜像站

pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple

4. 官方镜像源

pip config set global.index-url https://pypi.org/simple

5. 注意

  1. 第三方镜像源可能出现包或包对应的版本找不到情况,切换一下到其他镜像源就可以了。
你可以通过以下三种方法来配置Python镜像源: 1. 在pycharm内部配置:在pycharm中打开项目,点击"File"->"Settings"->"Project Interpreter",找到项目对应的Python解释器,点击右侧的齿轮图标,选择"Show All"。在弹出的窗口中,选择"Add",然后在"Available Packages"下方的输入框中添加镜像源地址,比如https://pypi.tuna.tsinghua.edu.cn/simple,点击"OK"保存配置即可。 2. 在命令行使用-i参数配置:打开命令行窗口,使用pip install命令安装包时,通过在命令末尾加上-i参数和镜像源地址来指定下载源,例如pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple。这样就会使用指定的镜像源下载并安装包。 3. 永久配置镜像源:在命令行中使用以下命令进行永久配置,在命令行中输入以下命令:pip config set global.index-url https://pypi.tuna.tsinghua.edu.***tsinghua.edu.cn/simple,以后使用pip安装包时就会使用该镜像源进行下载。 以上是三种常见的Python镜像源配置方法,你可以根据自己的需求选择适合的方法进行配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Python配置镜像源的三种方法](https://blog.csdn.net/weixin_45779095/article/details/120143727)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yimtcode

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值