pip永久设置清华大学镜像源

该博客内容介绍了如何打开命令行并使用`pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple`命令来配置pip,以便从清华大学的镜像源下载Python包,提高在国内的下载速度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

打开命令版

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

在这里插入图片描述

清华大学镜像源是一个国内的下载源,可以提高下载Python库的速度。你可以通过修改pip或anaconda的下载源来使用清华大学镜像源。 对于anaconda,你可以使用以下命令永久修改下载源: ``` conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --set show_channel_urls yes ``` 对于临时使用清华镜像源,你可以使用以下命令: ``` pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxx ``` 这里的xxx是你需要下载的包的名字,例如: ``` pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch ``` 通过修改默认配置,将服务器设置成国内的服务器,如清华镜像源,可以大幅度提高下载速度。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [用“清华镜像源”安装python库](https://blog.csdn.net/weixin_45465214/article/details/103605302)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [【Pythonpip配置清华镜像源](https://blog.csdn.net/yyj3900636/article/details/122744249)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值