安装

  1. 使用 apt 安装:

$ sudo apt-get install python-pip

  截止本文落笔,apt 安装 pip 版本为 1.0,但 pip 最新发行版本为 1.5.6

$ pip --version
pip 1.0 from /usr/lib/python2./dist-packages (python 2.7)

  pip 1.0 特性:

$ pip -h
Usage: pip COMMAND [OPTIONS] Options:
--version show program's version number and exit
-h, --help Show help
-E DIR, --environment=DIR
virtualenv environment to run pip in (either give the
interpreter or the environment base directory)
-s, --enable-site-packages
Include site-packages in virtualenv if one is to be
created. Ignored if --environment is not used or the
virtualenv already exists.
-v, --verbose Give more output
-q, --quiet Give less output
--log=FILENAME Log file where a complete (maximum verbosity) record
will be kept
--proxy=PROXY Specify a proxy in the form
user:passwd@proxy.server:port. Note that the
user:password@ is optional and required only if you
are behind an authenticated proxy. If you provide
user@proxy.server:port then you will be prompted for a
password.
--timeout=SECONDS, --default-timeout=SECONDS
Set the socket timeout (default seconds) Commands available:
bundle: Create pybundles (archives containing multiple packages)
freeze: Output all currently installed packages (exact versions) to stdout
help: Show available commands
install: Install packages
search: Search PyPI
uninstall: Uninstall packages
unzip: Unzip individual packages
zip: Zip individual packages

  2. 使用 get-pip.py 安装:

$ wget https://bootstrap.pypa.io/get-pip.py
... $ sudo python get-pip.py
...

  3. 升级

# On Linux or OS X
$ sudo pip install -U pip # On Windows
$ python -m pip install -U pip

使用

  1. 安装 package:

$ pip install SomePackage             # latest version
$ pip install SomePackage==1.0. # specific version
$ pip install 'SomePackage>=1.0.4' # minimum version

  1.1. 升级已安装包:

$ sudo pip install -U chardet

  2. 卸载 package:

$ sudo pip uninstall bottle

  3. 搜索 package:

$ pip search bottle

  4. 列出已安装 package:

$ pip list

  4.1. 列出过期 package:

$ pip list --outdated

  5. 显示已安装包详细信息

$ pip show gevent
---
Name: gevent
Version: 1.0.
Location: /usr/local/lib/python2./dist-packages
Requires: greenlet

问题

  1. 出现以下错误提示很可能是由于 SSL 未通过验证:

Cannot fetch index base URL http://pypi.python.org/simple/

  解决方法:检查系统时间是否正确,调整系统时间参考《设置系统时区》。

[Python] pip 简明指南的更多相关文章

  1. PyCharm使用指南及更改Python pip源为国内豆瓣

    PyCharm基本使用 1.在PyCharm下为python项目配置python本地解释器 setting-->Project:pycharm workspace-->Project In ...

  2. Python 编码风格指南

    原文:http://python.jobbole.com/84618/ 本文超出 PEP8 的范畴以涵盖我认为优秀的 Python 风格.本文虽然坚持己见,却不偏执.不仅仅涉及语法.模块布局等问题,同 ...

  3. PYTHON 最佳实践指南(转)

    add by zhj: 本文参考了The Hitchhiker's Guide to Python,当然也加入了作者的一些东西.The Hitchhiker's Guide to Python 的gi ...

  4. 【转】最全的 pip 使用指南,50% 你可能没用过

    [转]最全的 pip 使用指南,50% 你可能没用过 所有的 Python 开发者都清楚,Python 之所以如此受欢迎,能够在众多高级语言中,脱颖而出,除了语法简单,上手容易之外,更多还要归功于 P ...

  5. Python pip – error: invalid command ‘bdist_wheel’

    原文@http://software-engineer.gatsbylee.com/python-pip-error-invalid-command-bdist_wheel/ Python pip – ...

  6. 【转】git - 简明指南

    git - 简明指南 助你入门 git 的简明指南,木有高深内容 ;) 作者:罗杰·杜德勒 感谢:@tfnico, @fhd 和 Namics其他语言 english, deutsch, españo ...

  7. Python 绝对简明手册

    Python 绝对简明手册 help(函数名)来获取相关信息 另外,自带的文档和google也是不可少的 2. 基本语法2.1. if / elif / else x=int(raw_input(&q ...

  8. 关于virtualenvwrapper的python, pip 的版本的问题

    关于virtualenvwrapper的python, pip 的版本的问题: 在创建虚拟环境时, 我们可以用 mkvirtualenv THE_NAME_OF_VENV --python=pytho ...

  9. git - 简明指南

    助你入门 git 的简明指南,木有高深内容 ;) 作者:罗杰·杜德勒 感谢:@tfnico, @fhd 和 Namics如有纰漏,请在 github 提报问题 安装 下载 git OSX 版 下载 g ...

随机推荐

  1. Linux C Socket TCP编程介绍及实例

    转自:https://blog.csdn.net/lell3538/article/details/53335231 { printf("向服务器发送数据:%s\n",sendbu ...

  2. 子级div相对于父级div位置不变

    设置父级div为相对位置 设置子级div为绝对位置 代码如下: <!DOCTYPE html> <html> <head> <meta charset=&qu ...

  3. LiteIDE 在 Windows 下为 Go 语言添加智能提示代码补全

    本文以 Windows 7 64 位为环境,go1.4.2.windows-amd64 和 liteidex27.2.1.windows-qt5 为例. 成功搭建开发环境后,发现 LiteIDE 没有 ...

  4. SqlSession介绍

    SqlSession是MyBatis的关键对象,是执行持久化操作的对象,类似于JDBC中的Connection.它是应用程序与持久存储层之间执行交互操作的一个单线程对象,也是MyBatis执行持久化操 ...

  5. WPF腾讯视频通话开发

    一.IntPtr.HandleC#中的IntPtr类型称为“平台特定的整数类型”,它们用于本机资源,如窗口句柄. 1.WPF窗口句柄IntPtr wnip = new System.Windows.I ...

  6. Windows 7用U盘安装CentOS 7

    已经有Windows 7,准备再安装一个CentOS 7. 1. 划分磁盘空间 从磁盘上划分安装CentOS 7的安装空间.如果有多个硬盘的话,一定要在主硬盘上划分2G的空间(其实1G就够了)作为bo ...

  7. 【PMP】项目采购管理~重点知识

    1.合同的类型与区别 固定总价(FFP):大多数买方都喜欢这种合同,因为货物的采购价格在一开始就已确定,并且不允许改变(除非工作范围发生变更) 总价加激励费用(FPIF):这种总价合同给买方和卖方提供 ...

  8. xcode 报错 malloc: *** error for object 0x6c3c5a4: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug------d

    大家有时候会遇到这个错误 malloc: *** error for object 0x******: incorrect checksum for freed object - object was ...

  9. swift4.0 对 afn 进行二次封装

    先将  afn 用pod导入到 工程中 创建一个类 ZHttpTools 继承自 AFHTTPSessionManager 一般我们不希望网络请求同时有多个存在,所以我们将这个工具类  设计成单例 代 ...

  10. arcgis server缓存路径修改

    由于空间不够用,需要更换瓦片的输出路径,具体的修改方法如下: 1.打开ArcCatalog,打开GIS服务器,找到已经添加的gis服务器,一般都是机器名,如下所示,右键我的gis服务器(admin-t ...