Pip --target install


(Jendker) #1

Hello everyone,

I am browsing through the different sources about installation with brew’s python:
pip install --target="<path>" <package>

which does not work properly. I am getting following error:
DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both

I know that the problem is well known, but I didn’t find any clear information about a possible workaround. I tried the proposed solution from: https://docs.brew.sh/Homebrew-and-Python.html

python -m pip install --target="<path>" --install-option="--prefix=" <package>

but I am still getting the same error.

Is there a viable solution to that?


(Sean Molenaar) #2

The easiest solution I found was https://formulae.brew.sh/formula/brew-pip. I’m not even sure if the information on the page you linked is still accurate even, I recently installed things with --user and it was fine.