pip,conda安装包临时或者永久使用国内的源 ( 这里使用清华的源 )

清华pypi源的网址:https://pypi.tuna.tsinghua.edu.cn/simple
清华conda源的网址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

PIP 换源
临时更改:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

pip -i 选定从哪个网站下载python包

永久更改:

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

pip config set global.index-url + url

conda换源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以使用以下命令来临时使用清华镜像安装包: ``` conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' conda config --set show_channel_urls yes ``` 这样设置后,conda会优先从清华镜像下载安装包。请注意,这只是临时设置,只在当前会话中有效。如果你想永久使用清华镜像,可以使用以下命令: ``` 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 ``` 这样设置后,conda永久使用清华镜像下载安装包。如果你需要更多关于Anaconda镜像使用的帮助,可以参考清华镜像的官方帮助文档\[3\]。另外,如果你想让Python的pip使用国内镜像,可以参考这篇博客文章\[3\]。 #### 引用[.reference_title] - *1* [conda使用清华大学开镜像网站下载](https://blog.csdn.net/weixin_41041234/article/details/104279512)[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* [Python中pipconda使用清华镜像](https://blog.csdn.net/manchengpiaoxue/article/details/103591286)[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、付费专栏及课程。

余额充值