- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 193字
- 2021-07-02 21:09:35
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:

- 編程卓越之道(卷3):軟件工程化
- Web Development with Django Cookbook
- C/C++常用算法手冊(第3版)
- Spring實戰(第5版)
- SharePoint Development with the SharePoint Framework
- C++新經典
- Python數據結構與算法(視頻教學版)
- Linux C編程:一站式學習
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- 從零開始學Android開發
- 零基礎學C語言(升級版)
- Tableau Desktop可視化高級應用
- HTML5游戲開發實戰
- 基于Docker的Redis入門與實戰
- Python編程基礎與數據分析