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/

  • 相关阅读:
    Oracle笔记(十五) 数据库备份
    Oracle笔记(十四) 用户管理
    Oracle笔记(十三) 视图、同义词、索引
    Oracle笔记(十二) 集合、序列
    Oracle笔记(十一) 建表、更新、查询综合练习
    Oracle笔记(十) 约束
    Oracle笔记(八) 复杂查询及总结
    Oracle笔记(九) 表的创建及管理
    06-流程控制
    05-数据类型转换
  • 原文地址:https://www.cnblogs.com/zlsgh/p/8494435.html
Copyright © 2011-2022 走看看