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

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:

主站蜘蛛池模板: 陇西县| 邵东县| 安丘市| 桂东县| 涡阳县| 丽江市| 娄底市| 微博| 富裕县| 礼泉县| 黔东| 射阳县| 灵璧县| 太保市| 固始县| 邢台县| 拜城县| 长沙县| 缙云县| 启东市| 疏附县| 秭归县| 天祝| 康乐县| 翼城县| 宁安市| 海口市| 仁寿县| 屏山县| 旅游| 射阳县| 丰镇市| 庆城县| 砚山县| 清水县| 安丘市| 梁平县| 宁安市| 滨州市| 清丰县| 阳新县|