[Python] pip 简明指南
安装
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 简明指南的更多相关文章
- PyCharm使用指南及更改Python pip源为国内豆瓣
PyCharm基本使用 1.在PyCharm下为python项目配置python本地解释器 setting-->Project:pycharm workspace-->Project In ...
- Python 编码风格指南
原文:http://python.jobbole.com/84618/ 本文超出 PEP8 的范畴以涵盖我认为优秀的 Python 风格.本文虽然坚持己见,却不偏执.不仅仅涉及语法.模块布局等问题,同 ...
- PYTHON 最佳实践指南(转)
add by zhj: 本文参考了The Hitchhiker's Guide to Python,当然也加入了作者的一些东西.The Hitchhiker's Guide to Python 的gi ...
- 【转】最全的 pip 使用指南,50% 你可能没用过
[转]最全的 pip 使用指南,50% 你可能没用过 所有的 Python 开发者都清楚,Python 之所以如此受欢迎,能够在众多高级语言中,脱颖而出,除了语法简单,上手容易之外,更多还要归功于 P ...
- Python pip – error: invalid command ‘bdist_wheel’
原文@http://software-engineer.gatsbylee.com/python-pip-error-invalid-command-bdist_wheel/ Python pip – ...
- 【转】git - 简明指南
git - 简明指南 助你入门 git 的简明指南,木有高深内容 ;) 作者:罗杰·杜德勒 感谢:@tfnico, @fhd 和 Namics其他语言 english, deutsch, españo ...
- Python 绝对简明手册
Python 绝对简明手册 help(函数名)来获取相关信息 另外,自带的文档和google也是不可少的 2. 基本语法2.1. if / elif / else x=int(raw_input(&q ...
- 关于virtualenvwrapper的python, pip 的版本的问题
关于virtualenvwrapper的python, pip 的版本的问题: 在创建虚拟环境时, 我们可以用 mkvirtualenv THE_NAME_OF_VENV --python=pytho ...
- git - 简明指南
助你入门 git 的简明指南,木有高深内容 ;) 作者:罗杰·杜德勒 感谢:@tfnico, @fhd 和 Namics如有纰漏,请在 github 提报问题 安装 下载 git OSX 版 下载 g ...
随机推荐
- Oozie分布式工作流——流控制
最近又开始捅咕上oozie了,所以回头还是翻译一下oozie的文档.文档里面最重要就属这一章了--工作流定义. 一提到工作流,首先想到的应该是工作流都支持哪些工作依赖关系,比如串式的执行,或者一对多, ...
- 用c#监控网络状态
1.查询当前网络状态: using Microsoft.VisualBasic.Devices; //判断当前网络连接状态 Network nw=new Network(); if(nw.IsAvai ...
- git代码合并:Merge、Rebase的选择
代码合并:Merge.Rebase的选择 Zhongyi Tong edited this page on Dec 7, 2015 · 3 revisions Pages 19 Home 2.1 快速 ...
- python BeautifulSoup的简单使用
官网:https://www.crummy.com/software/BeautifulSoup/bs4/doc/ 参考:https://www.cnblogs.com/yupeng/p/336203 ...
- GraphQL: Object doesn't support property or method 'from'
From: https://github.com/graphql/graphiql/issues/688 psyCodelist commented 11 days ago Hi, Thank you ...
- Linux 安装 yum
1.使用RedHat系统不能正常使用yum安装 由于RedHat没有注册,所有不能使用它自身的资源更新, 查看安装源是否安装: # rpm –qa|grep yum 卸载安装源: # rpm –e – ...
- 学校公文办公处理系统_基于ASP.NET和Swfupload、FlashPaper2.2、校讯通短信发送的开发
学校新来了一个主管教学的副校长,他对他以前工作学校的公文处理系统表示高度留念,于是乎叫我们也开发一个. 我就参考了那个学校的办公管理系统,发现其实功能也蛮简单的,就是一个文件上传下载的功能,选择用户组 ...
- iOS开源项目之日志框架CocoaLumberjack
CocoaLumberjack是Mac和iOS上一个集快捷.简单.强大和灵活于一身的日志框架.CocoaLumberjack类似于流行的日志框架(如log4j),但它是专为Objective-C设计的 ...
- 2017 33 款iOS开源库
IGListKit https://github.com/Instagram/IGListKit 由 Instagram 开发人员制作,IGListKit 是用于构建快速灵活列表的数据驱动型的 UIC ...
- 鱼缸的启示:Scale-out和Scale-up架构
提到Scale-out和Scale-up,初看到可能会有点晕.其实我认为Scale-out和Scale-up的概念可以用一个简单的例子来解释. 不知您有没有养过鱼?当你只有六七条鱼的时候,一个小型鱼缸 ...