0

I want to install a pip package into a different directory, but pip refuses to do so.

$ pip install django -t output

File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 264, in finalize_options
    "must supply either home or prefix/exec-prefix -- not both"
DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both
  • Perhaps duplicates with this question: http://stackoverflow.com/questions/24257803/distutilsoptionerror-must-supply-either-home-or-prefix-exec-prefix-not-both – bman Dec 12 '16 at 12:44

1 Answers1

1

Update: When I wrote this answer pipenv was not available. If you having the same problem, I strongly recommend considering using it.

If you have installed Python using brew you need to add a setup.cfg file (source) in your project-dir with the following content:

[install]
prefix= 

That will resolve the problem. Alternatively, you can use virtualenv or even better docker.

bman
  • 5,016
  • 4
  • 36
  • 69