Configuration

Raspbian
Stretch includes configuration for pip to use piwheels by
default. If you're using an alternate distribution (or an older version of
Raspbian), you can use piwheels by placing the following lines in
etc/pip.conf:

[global]
extra-index-url=https://www.piwheels.hostedpi.com/simple

That's it! With this simple configuration change, pip should now
search piwheels for built distributions of packages and use them in preference
to building from source. You can test this out by creating a virtual
environment and attempting to install numpy
which usually involves a fairly lengthy compilation: