0

I am trying to link python2.7 to the most recent brew install, which corresponds to python 2.7.13. I know of answers like this link python with brew. But it's still confusing for me.

What I need is to have python2.7 link to /usr/local/Cellar/python/2.7.13/bin/python2.7. I can achieve python to link to /usr/local/Cellar/python/2.7.13/bin/python2.7.

The problem is I have scripts that call python2.7 and no matter what I do it always returns the old MacOS installation of python2.7.5.

I have also tried brew link --overwrite python@2 but the same thing happens.

Ideally I would like python to link to python3.6 and python2.7 to link to python2.7.13

1
  • this sounds hacky but how about a symlink of the old python installation with the new one
    – eagle
    Apr 18, 2018 at 17:51

1 Answer 1

1

Try to use virtual environment for your script virtual environment Doc

2
  • Thanks, I do use a virtualenv but this particular project created it's virtualenv so it's not up to me. Apr 18, 2018 at 17:38
  • 1
    So modify the virtual env, not your system installation.
    – chepner
    Apr 18, 2018 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.