- 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:

- The Modern C++ Challenge
- JavaScript 從入門到項目實踐(超值版)
- 從0到1:HTML+CSS快速上手
- Flash CS6中文版應(yīng)用教程(第三版)
- OpenShift在企業(yè)中的實踐:PaaS DevOps微服務(wù)(第2版)
- Learning JavaScript Data Structures and Algorithms
- Flutter跨平臺開發(fā)入門與實戰(zhàn)
- Java編程的邏輯
- Python Data Structures and Algorithms
- Python爬蟲、數(shù)據(jù)分析與可視化:工具詳解與案例實戰(zhàn)
- C語言程序設(shè)計與應(yīng)用(第2版)
- Beginning C++ Game Programming
- Lift Application Development Cookbook
- 寫給大家看的Midjourney設(shè)計書
- 數(shù)據(jù)分析與挖掘算法:Python實戰(zhàn)