一次使用pip后的总结

pip 常用命令及搭配操作


一 .当安装了多个版本python的时候,表示用pythonx 的pip 进行:

1.pythonx -m pip install + 包名 装 包
2.pythonx -m pip install + --upgrade pip 升级pip版本
3.pythonx -m pip uninstall + 包名 卸 载 包

二.换源命令:

1.pip    install   -i  https://pypi.tuna.tsinghua.edu.cn/simple    包名  (清华源)
2.pip    install   -i  http://pypi.douban.com/simple/   包名  (豆瓣源)

`注 :最好优先用清华的内源`

三.组合命令:

1.pythonx   -m  pip  install   -i  https://pypi.tuna.tsinghua.edu.cn/simple    包名

2.  sudo :
        (1)  sudo  pip   install    包名 
        (2)  sudo  pip   uninstall    包名     注 :特别是当某些包的卸载需要权限

3. pythonx   -m  pip  list/ -V    查看x 的包 和pip  版本

四 . 其他命令:

  1. pip - V 大写V 查看 pip 版本
  2. 2.python -V 大写V 查看 python 版本

五.安装scrapy:


注:scrapy安装在python2里面会有一些编码的问题,所以安装在python3里 为避免权限问题 ,每次安装的时候都最好加上sudo (安装任何一个包的时候都要确保pip的版本是最新且可用的)

1.先安装Twisted :
sudo python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple Twisted

2.安装 cryptography:
(1) sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
(2)sudo python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple cryptography
注:cryptography 的安装依赖很多东西,需要先执行(1)再执行(2)

3.安装scrapy:
sudo python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scrapy
(换源安装更快)


posted @ 2019-08-10 16:59  沐雨橙风~~  阅读(156)  评论(0编辑  收藏  举报