美文网首页
修改pip源为国内镜像,加速python包下载

修改pip源为国内镜像,加速python包下载

作者: 沉思的雨季 | 来源:发表于2022-02-23 15:02 被阅读0次

    方法一、通过命令设置

    通过shell或者DOS命令窗口,执行以下命令:

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

    方法二、修改配置文件

    在Linux系统,修改~/.pip/pip.conf文件;在Windows系统,修改C:\Users\XXX\pip\pip.ini文件。如果没有上述文件,需要手动建立。
    在文件中输入以下内容:

    [global]
    index-url = https://mirrors.aliyun.com/pypi/simple/
    

    附:pip国内镜像源

    阿里云:https://mirrors.aliyun.com/pypi/simple/
    中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
    清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/

    相关文章

      网友评论

          本文标题:修改pip源为国内镜像,加速python包下载

          本文链接:https://www.haomeiwen.com/subject/dopolrtx.html