BLD: Let pip/setuptools handle dependencies that aren't installed at all.

Closes gh-1897 and gh-1425.

Rebased version of #1902.