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 <搜索关键字>
Python pip 常用命令的更多相关文章
- python pip常用命令
pip安装命令: pip install packagename pip显示模块版本号: pip show packagename pip卸载模块: pip uninstall packagename ...
- [python]pip常用命令(转载)
用阿里云服务器,使用pip安装第三方库的时候卡的要死.所以我就想pip能不能安装本地的包. 找到了这篇博客: http://me.iblogc.com/2015/01/01/pip%E5%B8%B8% ...
- Windows下python 3 pip程序升级异常问题及pip常用命令
最近在学习,Selenium+Python自动化,在安装selenium包的时候,出现无法安装的情况,并提示Pip有新的版本,我的版本太低了.然后安装系统提示操作,pip升级也出现异常,报错timeo ...
- ubuntu源与常用python配置pip源(win)、pip常用命令
pip常用命令 ubuntu更新系统源 首先备份/etc/apt/sources.list mv /etc/apt/sources.list /etc/apt/sources.list.bak 然后下 ...
- pip 常用命令小结
pip 常用命令小结 pip这个工具我们经常会用到,毕竟python 是一门以第三方库庞大而著名的编程语言,所以我们总会用pip 安装一些依赖库,当然这只是pip 最常用的一个命令,下面就来介绍一下 ...
- PDB调试python代码常用命令
常用命令 where(w) 找出当前代码运行位置 list(l) 显示当前代码的部分上下文 list n(line number) 显示指定行的上下文 list m, n(line number) 显 ...
- 解决多版本共存时,python/pip等命令失效
问题呈现: Windows环境下,多版本Python解释器共存时,由于未配置环境变量或者反复卸载重装解释器等原因,CMD交互下输入Python或者pip等命令时失效 解决方式: 1)配置各个解释器的环 ...
- [Python] 安装 & 常用命令
安装 http://www.xue51.com/soft/2301.html 常用命令 #查看pip版本$ pip --version#安装pip$ sudo apt install python3- ...
- virtualenv的使用及pip常用命令
一.virtualenv 1.用途: virtualenv------用来建立一个虚拟的python环境,一个专属于项目的python环境.用virtualenv 来保持一个干净的环境非常有用. 例如 ...
随机推荐
- ql常见面试题 受用了
//转至:http://www.cnblogs.com/GT_Andy/archive/2009/12/25/1921911.html 1. 用一条SQL 语句 查询出每门课都大于80 分的学生姓名 ...
- neutron full stack
1. 通读一下 neutron的那个文档. 里面介绍了, db怎么隔离的, amqp怎么隔离的. 2. 记住文档中,那个full stack的图. 3. 走读代码 从TestOvsC ...
- the Captain题解;
BZOJ 4152 很显然这个题是让找最短路: 这种通过一个节点到达另一个点的路径我们可以想到dijkstra,然后这道题我们可以看到点是比较多的,所以我们怎么存图呢? 首先我们对于任意三个点,A(x ...
- replace 将逗号替换~
var reg = new RegExp(",","g"); //"g"表示全局替换var aa="qq,ww";aa= ...
- 如何将QT的pro图标修改的更显著一些
如何将QT的pro图标修改的更显著一些 QT的项目打开文件是pro,默认是这样的 这个白色的背景在很多文件中很不好找 所以使用工具进行相关修改. 寻找到.pro 双击修改ico 默认的这个就非常不错. ...
- 20145208 蔡野 《网络对抗》Exp7 网络欺诈技术防范
20145208 蔡野 <网络对抗>Exp7 网络欺诈技术防范 本实践的目标理解常用网络欺诈背后的原理,以提高防范意识,并提出具体防范方法.具体有(1)简单应用SET工具建立冒名网站(2) ...
- fatal: unable to access 'https://github.com/open-falcon/falcon-plus.git/': Peer reports incompatible or unsupported protocol version
git通过git clone下载github上的资源到机器上,结果出现如题所示的错误. [root@server data]# git clone https://github.com/pingcap ...
- python --- 11 第一类对象 函数名 闭包 迭代器
一 .函数名的运用 ①函数名是⼀个变量, 但它是⼀个特殊的变量, 与括号配合可以执⾏函数的变量 ②函数名是一个内存地址 ③ 函数名可以赋值给其他变量 ④函数名可以当做容器类 ...
- 用Navicat for Mysql导入.sql文件
1.在左边右键新建一个数据库 2.字符集选gbk(不 题) 3.打开数据库,把它变成绿色. 4.把.sql文件拖到这数据库上.会出现下边的运行SQL文件对话框,按开始,等运行完后就可以关掉了. 5.最 ...
- Spring 学习——Aware接口
Aware 作用 Spring中提供了一些以Aware结尾的接口,实现了Aware接口的Bean在初始化后,可以通过一些接口获取相应的资源. 通过Aware接口,可以对Spring的资源进行一些操作( ...