Python pip 常用命令汇总
作者:Blue·Sky 发布时间:2023-06-10 06:11:38
标签:Python,pip,命令
使用了这么就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


猜你喜欢
- 通过这个布局思路来做一个简单的后台管理系统也是OK的,大家可以参考一下啦!话不多说,还是先来梳理一下需要的第三方模块。PyQ5 的UI界面布
- 本文实例讲述了Python图像滤波处理操作。分享给大家供大家参考,具体如下:在图像处理中,经常需要对图像进行平滑、锐化、边界增强等滤波处理。
- 引子上下文管理器是一种简化代码的有力方式,其内部也蕴含了很多Python的编程思想,今天我们就来探究一下Python的上下文管理器。大家之前
- 上段时间,团队内部有过好几次几次给力的分享,这里对西风师傅分享的继承机制稍作整理一下,适当加了写口语化的描述,留作备案。一、讲个故事吧澄清在
- 首先说明,Supervisor 只能安装在 Python 2.x 环境中!但是基本上所有的 Linux 都同时预装了 Python 2.x
- 这篇文章主要介绍了Python爬取豆瓣视频信息代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋
- def cndebug(obj=False): """ Author : Nemon Update : 200
- 在Python中,字典是通过散列表或说哈希表实现的。字典也被称为关联数组,还称为哈希数组等。也就是说,字典也是一个数组,但数组的索引是键经过
- 如何自动登陆京东?我们先来看一下京东的登陆页面,如下图所示:【插入图片,登陆页面】登陆框就是右面这一个框框了,但是目前我们遇到一个困呐,默认
- 四则运算表达式求值思路说明使用双栈来实现——存放数值的栈 nums 与存放运算符
- tips: 路由绑定、菜单跳转、网页后退高亮显示1. 问题描述使用antd-vue 的 a-layout布局和a-menu菜单做一个侧边栏菜
- 在html中引入外部js文件,并调用js文件中的带参函数1 项目结构2 编写a.js、test.html//a.jsfunction abc
- 1. 系统盘清理说明win7 80G的系统盘,随着使用时间的增加,空间越来越小,只剩不到2G,随计划清理系统盘数据1. maven 下载的j
- 由于go对私有gitlab的仓库支持不好,得使用下面这些步骤设置git使用 ssh协议git config --global url.&qu
- 想要利用Python来操作word文档可以使用docx模块.安装: pip install python-docxfrom docx imp
- 强化功能本文针对中大型的后台项目的接口模块优化,在不影响项目正常运行的前提下,增量更新。接口文件写法简化(接口模块半自动化生成)任务调度、L
- 1 概述1.1 贪心算法贪心算法总是作出在当前看来最好的选择。也就是说贪心算法并不从整体最优考虑,它所作出的选择只是在某种意义上的局部最优选
- 最近在做一个小案例的时候遇到了Math.max.apply这么一个用法,之前很少遇到过感觉挺有趣的,就记录一下。1Math.max语法: M
- pytorch定义新的自动求导函数在pytorch中想自定义求导函数,通过实现torch.autograd.Function并重写forwa
- 本文实例讲述了Python3.5面向对象编程。分享给大家供大家参考,具体如下:1、面向过程与面向对象的比较(1)面向过程编程(procedu