Allow setup.py/pip to run query commands without needing numpy.

pip downloads and queries packages first, before trying to build them.
In a clean environment, numpy is missing and any query therefore fails,
though the build could actually proceed (provided numpy is built and
installed first).
A conditional import depending on the command used can prevent pip from
failing on the installation.
Merge pull request #257 from evertrol/setup-pip-numpy-requirement

Allow setup.py/pip to run query commands without needing numpy.