官术网_书友最值得收藏!

How to do it...

  1. To uninstall packages, run the pip uninstall <package_name> command. This will uninstall most packages on the system.
  2. Requirements files can be used to remove a number of packages at once, by using the -r option, such as pip uninstall -r <requirements_file>. The -y option allows for automatic confirmation of file removal.
  1. List currently installed packages by running pip list.

  1. To show packages that are outdated, use pip list --outdated, as follows:
      $ pip list --outdated
      docutils (Current: 0.10 Latest: 0.11)
      Sphinx (Current: 1.2.1 Latest: 1.2.2)

While it is possible to update all outdated packages at once, this is not available within pip itself. There are two primary options: the first involves using sedawk, or grep to walk through the list of packages, find the outdated packages, and update them. Alternatively, install the package pip-review to see outdated packages and update them. In addition, a number of other tools have been created by different developers, as well as instructions on how to do it yourself, so you should decide which works best for you.

Note: Automatically upgrading all Python packages can break dependencies. You should only update packages on an as-needed basis.

  1. Details of a particular installed package can be shown using pip show <package_name>, as follows:
      $ pip show sphinx
      Name: Sphinx
      Version: 1.7.2
      Summary: Python documentation generator
      Home-page: http://sphinx-doc.org/
      Author: Georg Brandl
      Author-email: georg@python.org
      License: BSD
      Location: /my/env/lib/python2.7/site-packages
      Requires: docutils, snowballstemmer, alabaster, Pygments, 
imagesize, Jinja2, babel, six
  1. Run the command pip search "query_string". The example below comes from https://pip.pypa.io/en/stable/reference/pip_search/, and shows how the output looks:
      $ pip search peppercorn
      pepperedform    - Helpers for using peppercorn with formprocess.
      peppercorn      - A library for converting a token stream into [...]
主站蜘蛛池模板: 巧家县| 襄城县| 攀枝花市| 克东县| 保定市| 眉山市| 遂溪县| 白水县| 察雅县| 丹巴县| 宜宾市| 鄯善县| 云林县| 娱乐| 临猗县| 安福县| 商丘市| 三台县| 红桥区| 新巴尔虎左旗| 原阳县| 勃利县| 唐山市| 吴忠市| 曲水县| 长沙县| 蓬莱市| 璧山县| 滨州市| 阿拉善盟| 和静县| 仙桃市| 新巴尔虎左旗| 滨海县| 抚远县| 洱源县| 寿宁县| 大埔区| 新田县| 闸北区| 五华县|