Several newbies are asking about the coexistence of Homebrew and pyenv on MacOSX Yosemite. This is what I'm still embarrassed about after applying my google-fu level to the topic. Sorry for the length, but I wanted to be as clear as possible.
Firstly, some background. I used brew to install pyenv, then pyenv to install python2 and python3.
brew install pyenv brew install pyenv-virtualenv *I also added the necessary hooks into my profiles.* pyenv install 2.7.10 pyenv install 3.4.3 pyenv rehash pyenv global 2.7.10
??? Question (or clarification). If brew uses the python installed by pyenv, I assume that it frowned because the brewed packages will be built depending on something outside of the brew (for example, using pyenv to remove the python version, the welded packages may break)? It looks like brew is using any python that comes in PATH first (currently the pyenv version is for me)? However, in each of the cases below, the gaskets are for python, not python3 (even for pyenv 3.4.3). Am I correct then assuming that installing "pyenv shell 3.4.3" will make python commands for brew links (which are supposed to be for python2.x), for pyenvs python 3.4.3, which I suppose will be confusing?
pyenv shell 2.7.10 brew --config Python: /Users/anonymous/.pyenv/shims/python => /Users/anonymous/.pyenv/versions/2.7.10/bin/python2.7 pyenv shell 3.4.3 brew --config Python: /Users/anonymous/.pyenv/shims/python => /Users/anonymous/.pyenv/versions/3.4.3/bin/python3.4 pyenv shell system brew --config Python: /Users/anonymous/.pyenv/shims/python => /usr/bin/python
??? Question. If using pyenvs pythons for brew with a bad idea, then should I also install brewing versions of python and python3, or is this a conflict and cause problems in some way? My options seem to either use the python system that was installed on my Mac or use my own brew pythons for all of my brewing needs. In the first case, I could just make sure you name βpyenv shell systemβ before any brewing or set some alias to automate it as others suggested (alias brew = "env PATH = $ {PATH // $ (pyenv root) / gaskets: /} brew "). However, this means that I should use the rather outdated system python. If instead I had to use brew to install python2 and python3, is it a conflict with versions installed using pyenv, or brew s pythons live happily completely separate from pyenvs (I think it's true, but I want to double check before I'll try)? This will give me a setting in which all my brewing used python brew or python3 (I suppose I still need an alias like the one above to make sure pyenvs versions are not found first in my PATH) and everything else outside of brew will use pyenvs pythons? Is this a bad idea for any reason?
pyenv global system *Add to profile:* alias brew="env PATH=${PATH//$(pyenv root)\/shims:/} brew" brew install python brew install python3
??? For example, consider a scenario in which I want to use brew to install boost-python with python3 bindings. Is this version of python3 required for cooking, and will it subsequently work for another version of python version 3.x ?. . If I only have pyenvs versions installed, does the -with-python3 flag work in this case? On the other hand, if I have brew s python3 installed in addition to pyenvs, I assume -with-python3 will refer to brew s python3 (with the above alias). If so, will boost-python even be used when calling from a python session with the pyenvs version (not sure if this is more appropriate as a question about boost-python itself), or is this completely normal?
brew install boost brew install boost-python
??? Symbolic link opinions for brew that point to pyenv python? Another post suggested symlinking pyenv pythons so that brew could find them. Besides the obvious caveat that brew now depends on python, which it itself does not control, is there anything terrible in this idea?
ln -s $(brew --cellar) ~/.pyenv/versions