目录
前言
学习Python的人一定知道pip install xxx
的作用,但是很少有人会去想背后的东西——pip安装的到底是什么?什么是.whl包?如果哪天我自己想写一个python包,应该怎么做?
一、初探pip安装过程
我们先来看两个pip安装包的过程。第一个是再熟悉不过的NumPy包:
$ pip install numpy
Collecting numpy
Downloading numpy-1.19.4-cp36-cp36m-manylinux2010_x86_64.whl (14.5 MB)
|████████████████████████████████| 14.5 MB 15.1 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.19.4
一个是uWSGI包(用来做什么的不用管)
$ pip install uwsgi
Collecting uwsgi
Downloading uWSGI-2.0.19.1.tar.gz (803 kB)
|████████████████████████████████| 803 kB 274 kB/s
Building wheels for collected packages: uwsgi
Building wheel for uwsgi (setup.py) ... done
Created wheel for uwsgi: filename=uWSGI-2.0.19.1-cp36-cp36m-linux_x86_64.whl size=597269 sha256=f2289db3db6d625f136f794be0319da477ad740e