[python]极好的pip 您所在的位置:网站首页 ps2哪个版本最好用 [python]极好的pip

[python]极好的pip

2024-07-09 03:13| 来源: 网络整理| 查看: 265

一.pip 1.为什么要用pip?

pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能。可以用命令行直接实行对包的管理,非常方便。

2.pip的下载?

目前如果你在 python.org 下载最新版本的安装包,则是已经自带了该工具。 Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具。 或者可以在https://pypi.org/project/pip/中直接安装。

可以通过如下命令查看是否安装成功

pip --version 或 pip -V

在这里插入图片描述 pip更新到最新版本

pip install -U pip 3.带你看pip的帮助文档

输入 pip --help 在这里插入图片描述 Usage: pip [options]

Commands: 1.安装包 install Install packages.

pip install SomePackage # 最新版本 pip install SomePackage==1.0.4 # 指定版本 pip install 'SomePackage>=1.0.4' # 最小版本

比如我要安装 Django。用以下的一条命令就可以,方便快捷。

pip install Django==1.7

(升级包)

pip install --upgrade SomePackage 或 pip install -U SomePackage

比如更新numpy 在这里插入图片描述

download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. 列出已安装的包。 list List installed packages. 在这里插入图片描述

显示有关已安装包的信息 show Show information about installed packages. pip show numpy Name: numpy Version: 1.19.0 Summary: NumPy is the fundamental package for array computing with Python.(概要: NumPy 是用 Python 进行数组计算的基本包。) Home-page: https://www.numpy.org(主页) 在这里插入图片描述 (作者)Author: Travis E. Oliphant et al. Author-email: None License: BSD (位置)Location: c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages Requires: (必须项)Required-by: matplotlib

check Verify installed packages have compatible dependencies.验证已安装的包是否具有兼容的依赖关系。 在这里插入图片描述 config Manage local and global configuration.管理本地和全局配置。 search Search PyPI for packages. cache Inspect and manage pip’s wheel cache. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. debug Show information useful for debugging. 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 to a verbose appending log. –proxy Specify a proxy in the form [user:passwd@]proxy.server:port. –retries Maximum number of retries each connection should attempt (default 5 times). –timeout Set the socket timeout (default 15 seconds). –exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort. –trusted-host Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS. –cert Path to alternate CA bundle. –client-cert Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. –cache-dir

Store the cache data in . –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 –no-python-version-warning Silence deprecation warnings for upcoming unsupported Pythons.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有