安装

  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. springboot中velocity tool中注入bean

    在使用springboo的时候,遇到一个问题,想在tool类中注入一个bean,一直失败,翻了下源码,是因为工具类的初始化方法为反射class调用newInstance方法,详见 http://www ...

  2. IE6的3像素bug

    IE6的3像素bug3像素bug是IE6的一个著名的bug,当浮动元素与非浮动元素相邻时,这个3像素的Bug就会出现.看下面这个左列固定,右列液态的例子,css代码如下: body { margin: ...

  3. WindowManager$BadTokenException: Unable to add window permission denied for this window type

    10-11 11:47:27.472: E/AndroidRuntime(12804): java.lang.RuntimeException: Unable to start activity Co ...

  4. 阿里云 RDS 与 DRDS 学习了解

    RDS 主页:https://help.aliyun.com/document_detail/26092.html?spm=5176.7741872.6.539.4h8LSC DRDS 主页:http ...

  5. 使用别名访问MSSQL Express

    当MSSQL Express安装成功后,默认只能用 .\sqlexpress 或者 (local)\sqlexpress 有时候我们希望使用(local) 就可以访问,此时就可以利用别名 1.MSSQ ...

  6. Go语言之高级篇beego框架之config、httplib、context

    一.httplib 1.配置文件解析 这是一个用来解析文件的库,它的设计思路来自于 database/sql,目前支持解析的文件格式有 ini.json.xml.yaml,可以通过如下方式进行安装: ...

  7. 未能找到temp\select2.cur的一部分

    环境 操作系统:win10 家庭普通版本 x64 账户类型:管理员 SuperMap:9D 打开自定义的应用程序时,会报错:未能找到路径"C:\Users\user\AppData\Loca ...

  8. [转]POJ3624 Charm Bracelet(典型01背包问题)

    来源:https://www.cnblogs.com/jinglecjy/p/5674796.html 题目链接:http://bailian.openjudge.cn/practice/4131/ ...

  9. C# MD5 加密,解密

    //生成cs文件 public class MD5Help { ///MD5加密 public static string MD5Encrypt(string pToEncrypt, string s ...

  10. 【Vegas原创】查询SQL Server更改记录的语句

    指定数据库,然后: select Name,Create_date,Modify_Date from sys.objects where type in ('U','P', 'V','F', 'TR' ...