3 对 “多版本python下使用pip”的想法;

  1. centos7下使用yum安装pip
    首先安装epel扩展源:

      yum -y install epel-release

      更新完成之后,就可安装pip:

      yum -y install python-pip

  2. pip国内的一些镜像

      阿里云 http://mirrors.aliyun.com/pypi/simple/
      中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
      豆瓣(douban) http://pypi.douban.com/simple/
      清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
      中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

    修改源方法:

    临时使用:
    可以在使用pip的时候在后面加上-i参数,指定pip源
    eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

    永久修改:
    linux:
    修改 ~/.pip/pip.conf (没有就创建一个), 内容如下:

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

  3. pip install xxx -proxy http:127.0.0.1:1080 代理

    在pip之前调用
    set http_proxy=http://127.0.0.1:8087
    不行可以试试下面的:
    set https_proxy=http://127.0.0.1:8087

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code