zoukankan      html  css  js  c++  java
  • python 使用国内源安装软件

    python linux 等 使用国内源安装软件 速度更快 你值得拥有 !

     

    豆瓣源:pip install -i https://pypi.douban.com/simple/

    阿里源:pip install -i http://mirrors.aliyun.com/pypi/simple/

    清华源:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/

    华中理工大学源 :pip install -i http://pypi.hustunique.com/simple/
    山东理工大学 pip install -i http://pypi.sdutlinux.org/simple/
    中国科学技术大学pip install -i http://pypi.mirrors.ustc.edu.cn/simple/

    1、使用 pip 安装软件(包):指定源

    pip install -i 源 软件(或者包)

    例如:pip install -i https://pypi.douban.com/simple pymysql

     2、一劳永逸的做法:

    •  linux下,在当前用户目录下

    修改 ~/.pip/pip.conf (没有就创建一个),

    修改 index-url至trusted-host,内容如下:

    [global]
    index
    -url = https://pypi.douban.com/simple/
    [install]
    trusted-host = mirrors.douban.com
    •  windows 下

      在你的“C:Users你的用户名”目录下创建“pip”目录,

    “pip”目录下创建“pip.ini”文件(注意:以UTF-8 无BOM格式编码);
    “pip.ini”文件内容:

    
    
    [global]
    index-url = https://pypi.douban.com/simple
    [install]
    trusted-host = mirrors.douban.com 
    
    
    注意:trusted-host 选项为了避免麻烦是必须的,否则使用的时候会提示不受信任,
    或者添加“--trusted-host=mirrors.aliyun.com”选项;

    注意:有网页提示需要创建或修改配置文件
    (linux的文件在~/.pip/pip.conf,windows在%HOMEPATH%pippip.ini),
    至少Windows7下“%HOMEPATH%pippip.ini”这个目录是不起作用的。
    • pycharm 指定第三方源

    点击File ---> Setting ---> Project Interpeter,

    点击右边的➕按钮弹出包管理界面 ,

    选择下方的Manage Repositories按钮,

    加入上面的镜像即可

     源地址的后面可以有“/”,也可以没有“/”:

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

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

  • 相关阅读:
    软件工程第二次作业
    软件工程第1次作业
    软件工程第0次作业
    第4次作业-案例分析
    第3次作业-四则运算
    第2次作业-效能分析
    第1次作业-词频统计
    第0次作业
    关于 石墨文档客户端 的案例分析
    结对编程
  • 原文地址:https://www.cnblogs.com/zlsgh/p/8494435.html
Copyright © 2011-2022 走看看