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

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:

主站蜘蛛池模板: 丰顺县| 巴青县| 沧州市| 鹤庆县| 中超| 怀远县| 吴川市| 麻城市| 宜城市| 上栗县| 武邑县| 科尔| 巧家县| 江西省| 德化县| 墨江| 奉节县| 泰安市| 凉城县| 彭阳县| 凤凰县| 姜堰市| 房产| 乐昌市| 包头市| 清涧县| 明光市| 固原市| 沾益县| 龙游县| 噶尔县| 尖扎县| 鄂州市| 许昌市| 阿瓦提县| 长沙市| 通许县| 大姚县| 读书| 博客| 临城县|