Python pip 常用命令汇总
作者:Blue·Sky 时间:2023-06-10 06:11:38
使用了这么就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> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should
attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--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 install
You must give at least one requirement to install (see "pip help install")
所以这里可以直接使用一下命令实现在线安装
pip install <包名> 或 pip install -r requirements.txt
通过使用== >= <= > <来指定版本,不写则安装最新版
requirements.txt内容格式为:
APScheduler==2.1.2
Django==1.5.4
MySQL-Connector-Python==2.0.1
MySQL-python==1.2.3
PIL==1.1.7
South==1.0.2
django-grappelli==2.6.3
django-pagination==1.0.7
安装本地安装包
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
标签:Python,pip,命令
0
投稿
猜你喜欢
golang使用json格式实现增删查改的实现示例
2024-04-27 15:36:51
深入解析MySQL的事务隔离及其对性能产生的影响
2024-01-27 11:17:07
Python读取xlsx文件报错:xlrd.biffh.XLRDError: Excel xlsx file;not supported问题解决
2021-02-02 16:08:59
20个优秀网站助你征服CSS[译]
2008-09-21 13:21:00
Vue为何弃用Ajax,选择Axios?ajax与axios的区别?
2024-04-30 10:38:52
Mysql 插入中文及中文查询 (修改+调试)
2024-01-21 23:52:42
Python中使用bidict模块双向字典结构的奇技淫巧
2023-05-12 19:37:55
XML轻松学习手册(3)XML的术语
2008-09-05 17:17:00
SQL 语句中的通配符
2007-10-11 18:03:00
tensorflow学习笔记之简单的神经网络训练和测试
2021-02-18 20:28:14
Python flask框架实现浏览器点击自定义跳转页面
2023-04-26 15:48:31
Python使用matplotlib.pyplot as plt绘图图层优先级问题
2022-06-10 18:00:37
分析与比较五种MySQL数据库可靠性方案
2009-07-30 08:25:00
Python实现在PyPI上发布自定义软件包的方法详解
2021-12-07 17:05:02
mysql5.7 修改用户初始密码的方法
2024-01-14 17:33:36
sqlserver中delete、update中使用表别名和oracle的区别
2024-01-19 15:21:49
python字典的常用方法总结
2023-07-11 01:45:17
Python异常之常见的Bug类型解决方法
2022-09-02 15:17:14
深入浅析JavaScript函数前面的加号和叹号
2024-04-18 10:55:41
python实现搜索指定目录下文件及文件内搜索指定关键词的方法
2023-06-22 22:49:41