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

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:

主站蜘蛛池模板: 河源市| 顺昌县| 红河县| 南丹县| 吐鲁番市| 明溪县| 徐闻县| 丹寨县| 赣州市| 循化| 台山市| 普兰店市| 潮州市| 英德市| 会宁县| 长治县| 宜都市| 晋城| 都昌县| 贵定县| 武清区| 双城市| 五河县| 武功县| 灵寿县| 工布江达县| 水城县| 依兰县| 鹿泉市| 汉源县| 娄烦县| 普洱| 平舆县| 隆尧县| 龙陵县| 江门市| 长治县| 成武县| 积石山| 绥芬河市| 海安县|