3

Is there a way to force pipenv install to use pre-built binaries from PyPI?

I have a pipenv environment with scipy and numpy, and currently pipenv install is trying to install these libraries from source. I can't, because I don't have a fortran compiler on my machine (MacOS), and I don't want to install one for various reasons.

Any help would be greatly appreciated. And thanks but I don't want to use Anaconda for this if I can help it.

william_grisaitis
  • 5,170
  • 3
  • 33
  • 40

1 Answers1

1

I had exactly the same problem with scipy. What worked for me was to add the following line to ".env":

PIP_ONLY_BINARY=ALL

If that doesn't work, you can always go to https://pypi.org/simple/scipy/ (Or any other package at the end) and search for the correct binary. Then copy the link of the correct binary and install that, for example:

pipenv install https://files.pythonhosted.org/packages/4d/b6/21b418b2b3dd548d2273d6963d66b3d775167da5f1a39e551ed0e857ccee/scipy-1.7.1-cp39-cp39-macosx_10_9_x86_64.whl#sha256=4ee952f39a4a4c7ba775a32b664b1f4b74818548b65f765987adc14bb78f5802

The correct binary can be found by running pip install scipy, which displays the name, for example here for me it would be "scipy-1.7.1-cp39-cp39-macosx_10_9_x86_64.whl". Just abort the pip installation or run pipenv clean after.

Onno Eberhard
  • 1,341
  • 1
  • 10
  • 18