- Secret Recipes of the Python Ninja
- Cody Jackson
- 289字
- 2021-06-25 22:14:41
How to do it...
- To uninstall packages, run the pip uninstall <package_name> command. This will uninstall most packages on the system.
- 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.
- List currently installed packages by running pip list.
- 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 sed, awk, 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.
- 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
- 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 [...]
推薦閱讀
- 數(shù)據(jù)科學實戰(zhàn)手冊(R+Python)
- Python數(shù)據(jù)可視化:基于Bokeh的可視化繪圖
- Practical Game Design
- Mastering Kali Linux for Web Penetration Testing
- Python數(shù)據(jù)可視化之Matplotlib與Pyecharts實戰(zhàn)
- 可解釋機器學習:模型、方法與實踐
- The DevOps 2.5 Toolkit
- IBM Cognos Business Intelligence 10.1 Dashboarding cookbook
- Mastering C++ Multithreading
- Python程序設(shè)計開發(fā)寶典
- Python開發(fā)基礎(chǔ)
- Python 3 Object:oriented Programming(Second Edition)
- Python預測分析實戰(zhàn)
- 深入理解Kafka:核心設(shè)計與實踐原理
- C Primer Plus(第6版)中文版【最新修訂版】