博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python pip 常用命令
阅读量:5009 次
发布时间:2019-06-12

本文共 3454 字,大约阅读时间需要 11 分钟。

使用了这么就pip命令,但是一直是简单使用,很多命令都是用了查,查了用,今天把常用的命令汇总一下,方便使用。

命令:

pip

 

 由上图可以看到 pip 支持一下命令

Commands:  install                     Install packages.  download                    Download packages.  uninstall                   Uninstall packages.  freeze                      Output installed packages in requirements format.  list                        List installed packages.  show                        Show information about installed packages.  check                       Verify installed packages have compatible dependencies.  search                      Search PyPI for packages.  wheel                       Build wheels from your requirements.  hash                        Compute hashes of package archives.  completion                  A helper command used for command completion.  help                        Show help for commands.

 

General Options:  -h, --help                  Show help.  --isolated                  Run pip in an isolated mode, ignoring                              environment variables and user configuration.  -v, --verbose               Give more output. Option is additive, and can be                              used up to 3 times.  -V, --version               Show version and exit.  -q, --quiet                 Give less output. Option is additive, and can be                              used up to 3 times (corresponding to WARNING,                              ERROR, and CRITICAL logging levels).  --log 
Path to a verbose appending log. --proxy
Specify a proxy in the form [user:passwd@]proxy.server:port. --retries
Maximum number of retries each connection should attempt (default 5 times). --timeout
Set the socket timeout (default 15 seconds). --exists-action
Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort. --trusted-host
Mark this host as trusted, even though it does not have valid or any HTTPS. --cert
Path to alternate CA bundle. --client-cert
Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. --cache-dir
Store the cache data in
. --no-cache-dir Disable the cache. --disable-pip-version-check Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.

 

1、install

pip installYou must give at least one requirement to install (see "pip help install")

 

 

所以这里可以直接使用一下命令实现在线安装

pip install 
<包名>
 或 pip install -r requirements.txt
通过使用== >= <= > 

 

安装本地安装包

pip install 
<目录>
/
<文件名>
或 pip install --use-wheel --no-index --find-links=wheelhouse/
<包名>

 

2、uninstall 

卸载安装包

pip uninstall 
<包名>
或 pip uninstall -r requirements.txt

 

升级包

pip install -U 
<包名>
或:pip install
<包名>
--upgrade

 

升级pip

pip install -U pip

使用pip安装插件的时候报错:You are using pip version 8.1.1, however version 9.0.1 is available.You should consider upgrading via the 'python -m pip install --upgrade pip' command.升级命令: python -m pip install --upgrade pip

 

 3、freeze

pip freeze,查看已经安装的包及版本信息。

 

导出到指定文件中,如图,注意 “ > ”,文件名称随意。常见按第二种写法。

 

4、list

 

 查询可升级的包

pip list -o

 

 

 

5、show

显示包所在目录及信息

 

6、search

搜索包

pip search 
<搜索关键字>

 

转载于:https://www.cnblogs.com/BlueSkyyj/p/8268621.html

你可能感兴趣的文章
java 代理的概念与作用
查看>>
get_free_page 和其友
查看>>
REVOKE - 删除访问权限
查看>>
解决UICollectionView的Cell复用引起的布局混乱问题
查看>>
校外实习报告(九)
查看>>
android之android.intent.category.DEFAULT的用途和使用
查看>>
CAGradientLayer 透明渐变注意地方(原创)
查看>>
【OpenSource】--Web Bench 1.5
查看>>
python-1:工欲善其事,必先利其器 安装配置Anaconda x32位 更新后,启动不了,解决方案(亲测)...
查看>>
Linux 命令(二) Linux下查看文件文件内容命令
查看>>
ubuntu系统如何屏幕截图
查看>>
ArcGIS Engine 创建索引(属性索引)——提高查询效率
查看>>
栅格数据AE
查看>>
开发笔记
查看>>
织梦DEDE多选项筛选_联动筛选功能的实现_二次开发
查看>>
SQL Server 排名函数 简单应用
查看>>
Could not find file "/var/www/default/bin\roslyn\csc.exe".
查看>>
关于软件工程的疑问
查看>>
iOS关于RunLoop和Timer
查看>>
SQL处理层次型数据的策略对比:Adjacency list vs. nested sets: MySQL【转载】
查看>>