How can I make homebrew's python and pyenv live together?

后端 未结 4 1505
北海茫月
北海茫月 2020-12-22 22:56

After switching to python 3.4.3 from 2.7.9 (which was quite simple), I often wish to test some of my scripts with python 2.7.9 before sharing them with colleagues. I am usin

4条回答
  •  再見小時候
    2020-12-22 23:48

    You can install pyenv in your home directory (as described in pyenv's installation guide), and then create a symlink at ~/.pyenv/versions to $(brew --cellar)/python:

    ln -s $(brew --cellar python)/* ~/.pyenv/versions/
    

    The way Homebrew works nowadays, this will pick up both 2.x and 3.x.

提交回复
热议问题