Python pip/pip3 常用命令

爱阅读很棒的看小说网站: http://www.aiyuedu.xin/

 

查找需要安装的包

pip search <包名>

安装python包

pip install 
pip install <包名>==1.0.4 
pip install -r requirements.txt 
pip install <包名> -i http://pypi.mirrors.ustc.edu.cn/simple/ 
pip install -e < local project path> (这个命令相当于pip install develop) 
阿里源:http://mirrors.aliyun.com/pypi/simple/ 
科大源:http://pypi.mirrors.ustc.edu.cn/simple/ 
清华源:http://mirrors.tuna.tsinghua.edu.cn/pypi/simple 
官方源:https://pypi.python.org/

在配置文件中指定安装源

直接在配置文件中添加源,如果没有配置文件可以手动添加一个 
/etc/pip.conf 
[global] 
timeout = 6000 
index-url = http://pypi.douban.com/simple

列出已经安装的包

pip list 
pip freeze

列出本地可以editable的项目

pip list -e

列出过期的包

pip list -o

升级包

pip install <包名> -U

安装的包所在目录

pip show -f <包名> 
pip show

卸载安装(python3最好使用pip3 如果遇到问题+sudo试试)

Uninstall packages. 
pip is able to uninstall most installed packages. Known exceptions are: 
Pure distutils packages installed with python setup.py install, which leave behind no metadata to >determine what files were installed. 
Script wrappers installed by python setup.py develop. 
pip also performs an automatic uninstall of an old version of a package before upgrading to a newer version.

pip uninstall <包名> 
pip uninstall -y -r requirement.txt

references: https://pip.pypa.io/en/latest/

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值