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

The pip tool for packages

Python, from version 3.4 onwards, is installed with a tool called pip, which can interface with the Python Package Index to automatically find, download, and install Python packages. If you already know the name of the package you want, and you have permission to write into Python's library directory, then this relatively simple command will get it fully installed and ready to be used.

In this instance, we installed a package called banknumber, which checks if someone's bank number is a valid bank number or is just a random number. For this, just add the python3 -m pip install banknumber command and hit Enter; we'll get the information as shown in the following screenshot:

If we don't have permission to Python's library directory, never fear. Python will look for a second user-specific library directory and since that library directory belongs to us, we'll always be able to install packages there.

To tell pip that we want to install into our personal library directory, just add --user to the command right after install. In the following screenshot, we are installing the requests package into our personal directory:

主站蜘蛛池模板: 肥乡县| 玉溪市| 黄梅县| 康马县| 电白县| 乌拉特中旗| 沾化县| 南投县| 曲阜市| 奉贤区| 永登县| 临夏市| 诸暨市| 绥德县| 安徽省| 水富县| 北宁市| 竹山县| 达州市| 密云县| 东阳市| 克东县| 驻马店市| 江津市| 乐业县| 牟定县| 吐鲁番市| 黄骅市| 南和县| 濉溪县| 安新县| 延庆县| 柳江县| 阜阳市| 明光市| 车致| 乌拉特前旗| 堆龙德庆县| 十堰市| 安图县| 清原|