[python]极好的pip | 您所在的位置:网站首页 › ps2哪个版本最好用 › [python]极好的pip |
一.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 --help 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(主页) check Verify installed packages have compatible dependencies.验证已安装的包是否具有兼容的依赖关系。 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 实验室设备网 版权所有 |