python 设置下载源,全局设置

推荐使用豆瓣的,个人感觉最好用,当然,你如果喜欢其它的,也可以设置。

pip config set golbal.index-url https://pypi.douban.com/simple

设置成功,windows 提示的配置文件在 .ini,macOS 提示在.conf文件

设置一次之后,以后下载第三方库,再也不用设置,比起官方的国外下载源,国内的快的显然不是一丁半点。

如果想换成其它下载源,直接替换 url 后面的链接即可

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:https://mirrors.aliyun.com/pypi/simple

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple

豆瓣:https://pypi.douban.com/simple
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Python中添加清华下载,可以按照以下步骤进行操作: 1. 打开命令提示符或终端窗口。 2. 输入以下命令并运行:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 该命令将把全局下载配置为清华镜像。 3. 确保你的网络连接正常,然后尝试使用pip安装模块,例如:pip install 库名 在这个命令中,替换“库名”为你想要安装的具体库的名称。使用清华镜像,可以实现更快的下载速度。 通过以上步骤,你就成功地将清华下载添加到Python中了。现在,你可以在使用pip安装模块时享受更快的下载速度了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Python如何添加下载](https://blog.csdn.net/m0_58002043/article/details/120990813)[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: 50%"] - *2* *3* [python如何设置清华镜像](https://blog.csdn.net/weixin_42750611/article/details/122044501)[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: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值