python:关于pip

简介: python:关于pip

python pip安装包的一些常用命令:

1 罗列出所有安装过的包:

pip list 或 pip freeze

2 安装包:

2.1 直接安装

$ pip install SomePackage            # 默认最新版
$ pip install SomePackage==1.0.4     # 某个指定版
$ pip install 'SomePackage>=1.0.4'     # 某个版本以上

2.2 从包列表文件里面依次安装

pip install -r example-requirements.txt 关于 example-requirements.txt:

#
####### example-requirements.txt #######
#
###### Requirements without Version Specifiers ######
nose
nose-cov
beautifulsoup4
#
###### Requirements with Version Specifiers ######
#   See https://www.python.org/dev/peps/pep-0440/#version-specifiers
docopt == 0.6.1             # Version Matching. Must be version 0.6.1
keyring >= 4.1.1            # Minimum version 4.1.1
coverage != 3.5             # Version Exclusion. Anything except version 3.5
Mopidy-Dirble ~= 1.1        # Compatible release. Same as >= 1.1, == 1.*
#
###### Refer to other requirements files ######
-r other-requirements.txt
#
#
###### A particular file ######
./downloads/numpy-1.9.2-cp34-none-win32.whl
http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl
#
###### Additional Requirements without Version Specifiers ######
#   Same as 1st section, just here to show that you can put things in any order.
rejected
green
#

2.3 指定安装的源

pip install SomePackage -i https://pypi.tuna.tsinghua.edu.cn/simple

3 升级包

pip install -U SomePackage

pip install --upgrade SomePackage

4 卸载包

pip uninstall SomePackage  或者 pip uninstall -r list.txt

5 显示某个包的信息....包所含文件列表:

pip show -f SomePackage

6 搜索包

pip search keyword

7 查询可升级包

pip list -o

目录
相关文章
|
异构计算 Python
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
998 1
|
人工智能 Shell Python
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
527 0
|
Python
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
1988 3
|
资源调度 前端开发 JavaScript
Python学习二:Python包管理器pip
这篇文章介绍了Python包管理器pip的基本概念、基本操作、如何更改下载源为国内镜像以加速下载,以及如何指定安装包的位置。
1115 0
Python学习二:Python包管理器pip
|
Python
python一键导出/导入pip库
python一键导出/导入pip库
697 1
|
Python
Python软件包管理工具pip实战篇
详细介绍了Python软件包管理工具pip的使用方法,包括安装、搜索、卸载软件包,修改软件源,导出和安装依赖列表,以及查看pip版本和配置信息等操作,并提供了相关命令示例。
812 0
Python软件包管理工具pip实战篇
|
Python
超详细的Python中 pip 常用命令,值得收藏!
超详细的Python中 pip 常用命令,值得收藏!
904 0
|
安全 IDE 开发工具
Python——记录pip问题(解决下载慢、升级失败问题)
Python——记录pip问题(解决下载慢、升级失败问题)
1931 1
|
开发者 Python
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
|
机器学习/深度学习 缓存 Linux
python环境学习:pip介绍,pip 和 conda的区别和联系。哪个更好使用?pip创建虚拟环境并解释venv模块,pip的常用命令,conda的常用命令。
本文介绍了Python的包管理工具pip和环境管理器conda的区别与联系。pip主要用于安装和管理Python包,而conda不仅管理Python包,还能管理其他语言的包,并提供强大的环境管理功能。文章还讨论了pip创建虚拟环境的方法,以及pip和conda的常用命令。作者推荐使用conda安装科学计算和数据分析包,而pip则用于安装无法通过conda获取的包。
3253 0

热门文章

最新文章

推荐镜像

更多