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

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:

主站蜘蛛池模板: 开阳县| 武义县| 岳池县| 上虞市| 肥西县| 韩城市| 邛崃市| 上高县| 高要市| 永嘉县| 广宁县| 万源市| 临沂市| 赣州市| 梁平县| 高青县| 井研县| 柘荣县| 巢湖市| 青神县| 勃利县| 石城县| 禄劝| 宜宾市| 腾冲县| 天祝| 长顺县| 烟台市| 巧家县| 黄冈市| 东安县| 建德市| 永胜县| 津南区| 固安县| 当阳市| 罗田县| 红安县| 宜黄县| 神木县| 都江堰市|