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

打印 上一主题 下一主题

主题 985|帖子 985|积分 2955

配景

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

list

pip3 list

show

pip3 show pyserial

-v 显示详细信息

install 安装

好比安装pyserial:pip3 install pyserial

其他

关键信息

     man手册

  1. PIP(1)                                                                  PIP(1)
  2. NAME
  3.        pip - A tool for installing and managing Python packages
  4. SYNOPSIS
  5.        pip <command> [options]
  6.        pip3 <command> [options]
  7. DESCRIPTION
  8.        pip  is  a  Python package installer, recommended for installing Python
  9.        packages which are not available in the Debian archive.   It  can  work
  10.        with  version  control repositories (currently only Git, Mercurial, and
  11.        Bazaar repositories), logs output  extensively,  and  prevents  partial
  12.        installs by downloading all requirements before starting installation.
  13.        On  Debian,  pip  is  the  command  to use when installing packages for
  14.        Python 2, while pip3 is the command to use when installing packages for
  15.        Python 3.
  16. COMMANDS
  17.        The  command comes before any options.  The following commands are rec-
  18.        ognized:
  19.        help   Show help for commands.
  20.        install
  21.               Install packages.
  22.        uninstall
  23.               Uninstall packages.
  24.        freeze Output installed packages in requirements format.
  25.        list   List installed packages.
  26.        show   Show information about installed packages.
  27.        search Search PyPI for packages.
  28.        wheel  Build wheels from your requirements.
  29. GENERAL OPTIONS
  30.        This list is by no means complete, and it only describes options avail-
  31.        able  to  all  commands.   Use pip <command> --help for more details on
  32.        command specific options.  A few command options are provided below.
  33.        -h, --help
  34.               Show more detailed command help.
  35.        -v, --verbose
  36.               Give more output. Option is additive, and can be used  up  to  3
  37.               times.
  38.        -V, --version
  39.               Show version and exit.
  40.        -q, --quiet
  41.               Give less output.
  42.        --log-file <path>
  43.               Path  to  a  verbose non-appending log, that only logs failures.
  44.               This log is active by default at ~/.pip/pip.log.
  45.        --log <path>
  46.               Path to a verbose  appending  log.   This  log  is  inactive  by
  47.               default.
  48.        --proxy <proxy>
  49.               Specify a proxy in the form [user:passwd@]proxy.server:port.
  50.        --timeout <sec>
  51.               Set the socket timeout (default 15 seconds).
  52.        --exists-action <action>
  53.               Default  action  when a path already exists: (s)witch, (i)gnore,
  54.               (w)ipe, (b)ackup.
  55.        --cert <path>
  56.               Path to alternate CA bundle.
  57. INSTALL OPTIONS
  58.        pip install installs packages from:
  59.           o PyPI (a.k.a. The Cheeseshop) and other indexes, using requirements
  60.             specifiers.
  61.           o VCS project urls.
  62.           o Local project directories.
  63.           o Local or remote source archives
  64.        -e,--editable <path/url>
  65.               Install  a  project  in editable mode (i.e.  setuptools "develop
  66.               mode") from a local project path or a VCS url.
  67.        -r,--requirement <file>
  68.               Install from the given requirements file.  This  option  can  be
  69.               used multiple times.
  70.        -b,--build <dir>
  71.               Directory  to unpack packages into and build in.  The default in
  72.               a virtualenv is "<venv path>/build".   The  default  for  global
  73.               installs is "<OS temp dir>/pip_build_<username>".
  74.        -t,--target <dir>
  75.               Install packages into <dir>.
  76.        -d,--download <dir>
  77.               Download packages into <dir> instead of installing them, regard-
  78.               less of what's already installed.
  79.        --download-cache <dir>
  80.               Cache downloaded packages in <dir>.
  81.        --src <dir>
  82.               Directory to check out editable projects into.  The default in a
  83.               virtualenv   is  "<venv  path>/src".   The  default  for  global
  84.               installs is "<current dir>/src".
  85.        -U, --upgrade
  86.               Upgrade all packages to  the  newest  available  version.   This
  87.               process  is  recursive  regardless  of  whether  a dependency is
  88.               already satisfied.
  89.        --force-reinstall
  90.               When upgrading, reinstall all packages even if they are  already
  91.               up-to-date.
  92.        -I, --ignore-installed
  93.               Ignore the installed packages (reinstalling instead).
  94.        --no-deps
  95.               Don't install package dependencies.
  96.        --install-option <options>
  97.               Extra  arguments  to be supplied to the setup.py install command
  98.               (use like --install-option ="--install-scripts=/usr/local/bin").
  99.               Use  multiple  --install-option options to pass multiple options
  100.               to setup.py install. If you are using an option with a directory
  101.               path, be sure to use absolute path.
  102.        --global-option <options>
  103.               Extra  global options to be supplied to the setup.py call before
  104.               the install command.
  105.        --user Install using the user scheme.
  106.        --egg  Install packages as eggs, not 'flat', like  pip  normally  does.
  107.               This option is not about installing from eggs. (WARNING: Because
  108.               this option overrides pip's normal install  logic,  requirements
  109.               files may not behave as expected.)
  110.        --root <dir>
  111.               Install everything relative to this alternate root directory.
  112.        --compile
  113.               Compile py files to pyc.
  114.        --no-compile
  115.               Do not compile py files to pyc.
  116.        --no-use-wheel
  117.               Do not find and prefer wheel archives when searching indexes and
  118.               find-links locations.
  119.        --pre  Include pre-release and development versions.  By  default,  pip
  120.               only finds stable versions.
  121.        --no-clean
  122.               Don't clean up build directories.
  123.        Package Index Options:
  124.        -i,--index-url <url>
  125.               Base     URL     of     Python     Package     Index    (default
  126.               https://pypi.python.org/simple/).
  127.        --extra-index-url <url>
  128.               Extra URLs of package indexes to use in addition to --index-url.
  129.        --no-index
  130.               Ignore  package  index  (only  looking  at   --find-links   URLs
  131.               instead).
  132.        -f,--find-links <url>
  133.               If  a  url  or path to an html file, then parse for links to ar-
  134.               chives. If a local path or file:// url that's a directory,  then
  135.               look for archives in the directory listing.
  136.        --allow-external <package>
  137.               Allow the installation of externally hosted files
  138.        --allow-all-external
  139.               Allow the installation of all externally hosted files
  140.        --allow-unverified <package>
  141.               Allow the installation of insecure and unverifiable files
  142.        --process-dependency-links
  143.               Enable the processing of dependency links.
  144. UNINSTALL OPTIONS
  145.        pip is able to uninstall most installed packages. Known exceptions are:
  146.           o Pure  distutils  packages  installed with python setup.py install,
  147.             which leave behind  no  metadata  to  determine  what  files  were
  148.             installed.
  149.           o Script wrappers installed by python setup.py develop.
  150.        -r,--requirement <file>
  151.               Uninstall  all  the  packages  listed  in the given requirements
  152.               file.  This option can be used multiple times.
  153.        -y, --yes
  154.               Don't ask for confirmation of uninstall deletions.
  155. AUTHORS
  156.        This  manual  page  was  originally  written   by   Jeff   Licquia   <-
  157.        licquia@debian.org>,    later    rewritten    by    Carl    Chenet   <-
  158.        chaica@debian.org>.  It was rewritten again and the source converted to
  159.        reStructuredText by Barry Warsaw <barry@debian.org>.
  160.        Permission  is  granted to copy, distribute and/or modify this document
  161.        under the terms of the GNU General Public License,  version  3  or  any
  162.        later version published by the Free Software Foundation.
  163. AUTHOR
  164.        Barry Warsaw <barry@debian.org>
  165. 1.5.6                             2014-06-03                            PIP(1)
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

风雨同行

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表