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

- Learning Apex Programming
- Java程序設(shè)計(jì)與計(jì)算思維
- Animate CC二維動(dòng)畫設(shè)計(jì)與制作(微課版)
- Mastering Ubuntu Server
- Learn Swift by Building Applications
- Cassandra Data Modeling and Analysis
- CouchDB and PHP Web Development Beginner’s Guide
- Reactive Android Programming
- HTML 5與CSS 3權(quán)威指南(第3版·上冊(cè))
- Unity Character Animation with Mecanim
- Data Science Algorithms in a Week
- QlikView Unlocked
- ASP.NET求職寶典
- 大話代碼架構(gòu):項(xiàng)目實(shí)戰(zhàn)版
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)