The following takes place in a Python 3 virtual environment.
I just authored a little package that requires numpy
. So, in setup.py
, I wrote install_requires=['numpy']
. I ran python3 setup.py install
, and it took something like two minutes -- I got the full screen dump of logs, warnings, and configurations that normally comes with a numpy installation.
Then, I created a new virtual environment, and this time simply wrote pip3 install numpy
-- which took only a few seconds -- and then ran python3 setup.py install
, and I was done almost immediately.
What's the difference between the two, and why was pip3 install numpy
so much faster? Should I thus include a requirements.txt
just so people can pip-install the requirements rather than using setuptools?
Note that when I wrote pip3 install numpy
, I got the following:
Collecting numpy
Using cached numpy-1.12.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.12.0
Is it possible that this was so much faster because the numpy wheel was already cached?