风雨同行 发表于 2024-12-18 12:05:04

微知-python包管理工具pip怎样检察安装了某个库?(pip3 show xxx;pip3 li

配景

pip是python的一个包管理工具。平时只是install,但是很少检察安装了哪些?以及某个包详细信息。本文重要介绍list列出所有的包,以及show检察某个详细信息。顺带介绍install。
命令

list

pip3 list
https://i-blog.csdnimg.cn/direct/38ef1784a3b444fb835722fe5e1a44c0.png
show

pip3 show pyserial
https://i-blog.csdnimg.cn/direct/c88ce129e6c94843aaa02e2b74d00d86.png
-v 显示详细信息
https://i-blog.csdnimg.cn/direct/fbf3917a67c34814a85bfc5a539e6b75.png
install 安装

好比安装pyserial:pip3 install pyserial
https://i-blog.csdnimg.cn/direct/bb9730d03c824f89a174fd1050a1a1e6.png
其他

关键信息

   man手册

PIP(1)                                                                  PIP(1)



NAME
       pip - A tool for installing and managing Python packages

SYNOPSIS
       pip <command>

       pip3 <command>

DESCRIPTION
       pipisaPython package installer, recommended for installing Python
       packages which are not available in the Debian archive.   Itcanwork
       withversioncontrol repositories (currently only Git, Mercurial, and
       Bazaar repositories), logs outputextensively,andpreventspartial
       installs by downloading all requirements before starting installation.

       OnDebian,pipisthecommandto use when installing packages for
       Python 2, while pip3 is the command to use when installing packages for
       Python 3.

COMMANDS
       Thecommand comes before any options.The following commands are rec-
       ognized:

       help   Show help for commands.

       install
            Install packages.

       uninstall
            Uninstall packages.

       freeze Output installed packages in requirements format.

       list   List installed packages.

       show   Show information about installed packages.

       search Search PyPI for packages.

       wheelBuild wheels from your requirements.

GENERAL OPTIONS
       This list is by no means complete, and it only describes options avail-
       abletoallcommands.   Use pip <command> --help for more details on
       command specific options.A few command options are provided below.

       -h, --help
            Show more detailed command help.

       -v, --verbose
            Give more output. Option is additive, and can be usedupto3
            times.

       -V, --version
            Show version and exit.

       -q, --quiet
            Give less output.

       --log-file <path>
            Pathtoaverbose non-appending log, that only logs failures.
            This log is active by default at ~/.pip/pip.log.

       --log <path>
            Path to a verboseappendinglog.   Thislogisinactiveby
            default.

       --proxy <proxy>
            Specify a proxy in the form proxy.server:port.

       --timeout <sec>
            Set the socket timeout (default 15 seconds).

       --exists-action <action>
            Defaultactionwhen a path already exists: (s)witch, (i)gnore,
            (w)ipe, (b)ackup.

       --cert <path>
            Path to alternate CA bundle.

INSTALL OPTIONS
       pip install installs packages from:

          o PyPI (a.k.a. The Cheeseshop) and other indexes, using requirements
            specifiers.

          o VCS project urls.

          o Local project directories.

          o Local or remote source archives

       -e,--editable <path/url>
            Installaprojectin editable mode (i.e.setuptools "develop
            mode") from a local project path or a VCS url.

       -r,--requirement <file>
            Install from the given requirements file.Thisoptioncanbe
            used multiple times.

       -b,--build <dir>
            Directoryto unpack packages into and build in.The default in
            a virtualenv is "<venv path>/build".   Thedefaultforglobal
            installs is "<OS temp dir>/pip_build_<username>".

       -t,--target <dir>
            Install packages into <dir>.

       -d,--download <dir>
            Download packages into <dir> instead of installing them, regard-
            less of what's already installed.

       --download-cache <dir>
            Cache downloaded packages in <dir>.

       --src <dir>
            Directory to check out editable projects into.The default in a
            virtualenv   is"<venvpath>/src".   Thedefaultforglobal
            installs is "<current dir>/src".

       -U, --upgrade
            Upgrade all packages tothenewestavailableversion.   This
            processisrecursiveregardlessofwhethera dependency is
            already satisfied.

       --force-reinstall
            When upgrading, reinstall all packages even if they arealready
            up-to-date.

       -I, --ignore-installed
            Ignore the installed packages (reinstalling instead).

       --no-deps
            Don't install package dependencies.

       --install-option <options>
            Extraargumentsto be supplied to the setup.py install command
            (use like --install-option ="--install-scripts=/usr/local/bin").
            Usemultiple--install-option options to pass multiple options
            to setup.py install. If you are using an option with a directory
            path, be sure to use absolute path.

       --global-option <options>
            Extraglobal options to be supplied to the setup.py call before
            the install command.

       --user Install using the user scheme.

       --eggInstall packages as eggs, not 'flat', likepipnormallydoes.
            This option is not about installing from eggs. (WARNING: Because
            this option overrides pip's normal installlogic,requirements
            files may not behave as expected.)

       --root <dir>
            Install everything relative to this alternate root directory.

       --compile
            Compile py files to pyc.

       --no-compile
            Do not compile py files to pyc.

       --no-use-wheel
            Do not find and prefer wheel archives when searching indexes and
            find-links locations.

       --preInclude pre-release and development versions.Bydefault,pip
            only finds stable versions.

       --no-clean
            Don't clean up build directories.

       Package Index Options:

       -i,--index-url <url>
            Base   URL   of   Python   Package   Index    (default
            https://pypi.python.org/simple/).

       --extra-index-url <url>
            Extra URLs of package indexes to use in addition to --index-url.

       --no-index
            Ignorepackageindex(onlylookingat   --find-links   URLs
            instead).

       -f,--find-links <url>
            Ifaurlor path to an html file, then parse for links to ar-
            chives. If a local path or file:// url that's a directory,then
            look for archives in the directory listing.

       --allow-external <package>
            Allow the installation of externally hosted files

       --allow-all-external
            Allow the installation of all externally hosted files

       --allow-unverified <package>
            Allow the installation of insecure and unverifiable files

       --process-dependency-links
            Enable the processing of dependency links.

UNINSTALL OPTIONS
       pip is able to uninstall most installed packages. Known exceptions are:

          o Puredistutilspackagesinstalled with python setup.py install,
            which leave behindnometadatatodeterminewhatfileswere
            installed.

          o Script wrappers installed by python setup.py develop.

       -r,--requirement <file>
            Uninstallallthepackageslistedin the given requirements
            file.This option can be used multiple times.

       -y, --yes
            Don't ask for confirmation of uninstall deletions.

AUTHORS
       Thismanualpagewasoriginallywritten   by   Jeff   Licquia   <-
       licquia@debian.org>,    later    rewritten    by    Carl    Chenet   <-
       chaica@debian.org>.It was rewritten again and the source converted to
       reStructuredText by Barry Warsaw <barry@debian.org>.

       Permissionisgranted to copy, distribute and/or modify this document
       under the terms of the GNU General Public License,version3orany
       later version published by the Free Software Foundation.

AUTHOR
       Barry Warsaw <barry@debian.org>




1.5.6                           2014-06-03                            PIP(1)

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 微知-python包管理工具pip怎样检察安装了某个库?(pip3 show xxx;pip3 li