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

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:

主站蜘蛛池模板: 同德县| 搜索| 长乐市| 成武县| 万全县| 迭部县| 徐闻县| 辽阳市| 阿拉尔市| 滨州市| 东乡| 安仁县| 景谷| 杨浦区| 重庆市| 新昌县| 五峰| 闵行区| 平湖市| 清镇市| 镇安县| 喀喇沁旗| 华安县| 龙山县| 高唐县| 博爱县| 荥阳市| 玉环县| 南华县| 磴口县| 临汾市| 邯郸市| 土默特右旗| 灌南县| 江山市| 文水县| 中宁县| 黄梅县| 乌兰浩特市| 饶阳县| 紫阳县|