Linux 包管理工具 pip 使用詳解


1. pip install 安裝軟件

[example@admin ~]$ pip install somepackage
[...]
Successfully installed somepackage

參數:
--upgrade 升級某包

 2. pip show 查看已安裝的軟件(以matplotlib為例子)

[example@admin ~]$ pip show matplotlib
---
Metadata-Version: 1.1
Name: matplotlib
Version: 1.4.3
Summary: Python plotting package
Home-page: http://matplotlib.org
Author: John D. Hunter, Michael Droettboom
Author-email: mdroe@stsci.edu
License: BSD
Location: /usr/local/lib/python3.4/site-packages
Requires: numpy, six, python-dateutil, pytz, pyparsing, nose, nose

參數:
--files 列出文件地址

 3. pip list 列出現有軟件

[example@admin ~]$ pip list
matplotlib (1.4.3)
nose (1.3.7)
numpy (1.9.2)
[...]
Name (Version)

參數:
--outdated 需要更新的軟件

4. pip uninstall 卸載某軟件

[example@admin ~] pip uninstall somepackage
Uninstalling somepackage:
/my/env/lib/pythonx.x/site-packages/somepackage
Proceed (y/n)? y
Successfully uninstalled somepackage

 5. pip --help 幫助

[example@admin ~] pip --help

Usage:
  pip <command> [options]

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.
  wheel                       Build wheels from your requirements.
  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.
  --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.
  --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.

 

 

 

 


參考資料:linux中pip安裝步驟和使用詳解


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM