Python之pip:Python语言中的pip的简介、安装、使用方法之详细攻略(一)

简介: Python之pip:Python语言中的pip的简介、安装、使用方法之详细攻略

pip的简介


       pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能。目前如果你在 python.org 下载最新版本的安装包,则是已经自带了该工具。 Python 3.4+ 以上版本都自带 pip 工具。pip这个工具,可以很方便的线上安装依赖库,并且,pip还有很多参数都可以帮我们去查询一些库信息



pip官网:https://pypi.org/project/pip/




pip的安装


1、Linux之Ubuntu系统安装pip3


sudo apt install python3-pip

image.png







pip的使用方法


相关文章

Python语言学习:python常用自带方法、头部代码、python调式、pip命令集合、常见概念详细攻略(解决问题为导向)

pip:成功解决pip下载时速度超慢的几种方法


1、Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.  

$ pip install --pre SomePackage

2、超级权限下载或更新库

pip install --upgrade scipy --use


image.png


1、pip命令集合


Usage:

 pip <command> [options]

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.

 config                      Manage local and global configuration.

 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.

 --no-color                  Suppress colored output


相关文章
|
7天前
|
Ubuntu Python
Ubuntu 安装Python3.8
Ubuntu 安装Python3.8
33 0
|
1天前
|
Web App开发 测试技术 Python
【如何学习python自动化测试】—— 浏览器驱动的安装 以及 如何更新driver
【如何学习python自动化测试】—— 浏览器驱动的安装 以及 如何更新driver
6 0
|
2天前
|
Web App开发 测试技术 C++
Playwright安装与Python集成:探索跨浏览器测试的奇妙世界
Playwright是新兴的跨浏览器测试工具,相比Selenium,它支持Chrome、Firefox、WebKit,执行速度快,选择器更稳定。安装Playwright只需一条`pip install playwright`的命令,随后的`playwright install`会自动添加浏览器,无需处理浏览器驱动问题。这一优势免去了Selenium中匹配驱动的烦恼。文章适合寻求高效自动化测试解决方案的开发者。
11 2
|
4天前
|
关系型数据库 MySQL 数据库
Python Stock安装与使用
Python Stock安装与使用
|
4天前
|
Shell 数据安全/隐私保护 Docker
docker安装anaconda3 python环境
docker安装anaconda3 python环境
11 0
|
5天前
|
JSON 数据格式 开发者
pip和requests在Python编程中各自扮演着不同的角色
【5月更文挑战第9天】`pip`是Python的包管理器,用于安装、升级和管理PyPI上的包;`requests`是一个HTTP库,简化了HTTP通信,支持各种HTTP请求类型及数据交互。两者在Python环境中分别负责包管理和网络请求。
24 5
|
6天前
|
数据采集 iOS开发 MacOS
Python及Pycharm安装教程
Python及Pycharm安装教程
24 0
|
15天前
|
Linux Python Windows
Python更换国内pip源详细教程
Python更换国内pip源详细教程
|
5月前
|
Python
Python 工具和库:解释什么是 PIP?如何使用 PIP 安装 Python 包?
Python 工具和库:解释什么是 PIP?如何使用 PIP 安装 Python 包?