- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 242字
- 2021-07-02 21:09:35
Managing installed packages
The pip tool can do more than just installing packages. It can also give us the following:
- A list of currently installed packages using the -m pip list command:

- Upgrade currently installed packages to the newest version using the -m pip install --upgrade command:

- Uninstall packages that we don't need anymore using the -m pip uninstall command. For example, if we want to uninstall the banknumber package, we can do it by using the following command, shown in this screenshot:

In short, it's a complete cross-platform management tool for Python packages.
Some Python packages require that we be able to compile extensions written in the C programming language to install them, but fortunately that's becoming rare. Normally, if the compiled extension is required, pip will be able to find and install the proper precompiled version automatically. The majority of available packages are pure Python anyhow and don't require compilation.
The pip tool has many more great options and command-line switches, but what we've seen so far covers the common situations well. If you want to dig into it further, pip's help command will give you the details. For example, consider the following command:
pip help install
The preceding command prints out all the information you could possibly want about the pip install option:

So, now that we know how to install third-party packages using pip, how do we go about actually finding packages to install in the first place?
推薦閱讀
- Android Wearable Programming
- C++ Primer習題集(第5版)
- 騰訊iOS測試實踐
- WebAssembly實戰
- C++面向對象程序設計(微課版)
- Learn Scala Programming
- Haskell Data Analysis Cookbook
- iOS開發實戰:從入門到上架App Store(第2版) (移動開發叢書)
- MongoDB,Express,Angular,and Node.js Fundamentals
- HTML5秘籍(第2版)
- 深度探索Go語言:對象模型與runtime的原理特性及應用
- Scala編程實戰
- Java核心編程
- 用Python動手學統計學
- 網絡工程方案設計與實施(第二版)