python 镜像源配置

1.1 手动添加镜像源

使用方法:pip install 包名 -i 所用镜像源网址(这里我用的清华源)

1) pip install 下载的模块名 -i https://pypi.tuna.tsinghua.edu.cn/simple

1.2 永久添加镜像源

使用方法一:打开cmd 添加如下命令

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

使用方法二:在C盘下创建一个名叫pip的文件夹,在文件夹内创建一个名为pip.ini的文档,添加如下内容,将pip路径添加到环境变量。

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

1.3 国内镜像源 

① 阿里镜像 :  https://mirrors.aliyun.com/pypi/simple/

② 百度镜像:

 https://mirror.baidu.com/pypi/simple/

③ 清华镜像:

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

④ 中科大镜像:

 https://pypi.mirrors.ustc.edu.cn/simple/

  ⑤ 豆瓣镜像:

http://pypi.douban.com/simple/

  ⑥ 搜狐镜像:

http://mirrors.sohu.com/Python/

    ⑦ 华中科大镜像:

https://pypi.hustunique.com/

    ⑧ 山东理工大学镜像:

https://pypi.hustunique.com/

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以通过以下三种方法来配置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
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值