pip常用记录

同电脑多版本python

python2 -m pip install 包名(python2指向2.7的python.exe)

指定版本

pip install 包名==版本号

指定源

pip install receive http://mirrors.aliyun.com/pypi/simple/

某些包可能因为被墙,或者某个源没有,可以尝试指定其他源安装

pip常用源

  1. 阿里云 http://mirrors.aliyun.com/pypi/simple/
  2. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  3. 豆瓣 (douban) http://pypi.douban.com/simple/
  4. 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
  5. 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
C:UsersuserDesktopweb_py>python2 -m pip install receive http://mirrors.aliyun.com/pypi/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting http://mirrors.aliyun.com/pypi/simple/
  Downloading http://mirrors.aliyun.com/pypi/simple/ (7.6MB)
    100% |████████████████████████████████| 7.6MB 55kB/s
  Cannot unpack file c:usersuserappdatalocal	emppip-unpack-zc4dwksimple.html (downloaded from c:usersuserappdatalocal	emppip-req-build-v59wki, content-type: text/html); cannot detect archive format
Cannot determine archive format of c:usersuserappdatalocal	emppip-req-build-v59wki

C:UsersuserDesktopweb_py>python2 -m pip install receive https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting https://pypi.mirrors.ustc.edu.cn/simple/
  Downloading https://pypi.mirrors.ustc.edu.cn/simple/ (7.7MB)
    100% |████████████████████████████████| 7.7MB 547kB/s
  Cannot unpack file c:usersuserappdatalocal	emppip-unpack-qm3x7wsimple (downloaded from c:usersuserappdatalocal	emppip-req-build-tvbhov, content-type: text/html; charset=UTF-8); cannot detect archive format
Cannot determine archive format of c:usersuserappdatalocal	emppip-req-build-tvbhov
View Code
原文地址:https://www.cnblogs.com/lurenjia1994/p/9628699.html