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

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?

主站蜘蛛池模板: 宝兴县| 阜城县| 朝阳市| 稻城县| 射洪县| 云南省| 仁布县| 福清市| 大宁县| 高台县| 江孜县| 从化市| 塔河县| 弥勒县| 寿宁县| 盐源县| 朝阳区| 抚州市| 龙里县| 公主岭市| 大宁县| 普陀区| 鄯善县| 塔城市| 山东省| 马尔康县| 玛曲县| 道真| 团风县| 墨脱县| 疏附县| 石林| 阳城县| 吉林省| 霍邱县| 青冈县| 济南市| 济宁市| 佛坪县| 安岳县| 鲁山县|