Reputation: 143
Is it possible to use system python in homebrew?
I have python 2.7.5 installed on my mac, but when I try to install any homebrew package with python in dependencies, it starts loading python 2.7.9.
It is important for me to use system python because of lots of installed python packages.
Upvotes: 1
Views: 1363
Reputation: 82560
What version of python homebrew uses depends on two things:
python
alias points to.In most cases, homebrew forumlae simply use the python
command, and does not specify a python path. If it does, then it is usually /usr/bin/python
.
So, you can fix the problem in two ways:
python
command points to.The first option is problematic, since it means that you need to go into your Cellar
folder, and alter things. This is not nice, and usually not required.
A better alternative is to point to the right python
command. This is where pyenv
comes in handy. pyenv
is a command line tool that helps you manage different versions of python. Follow the instructions here:
https://github.com/yyuu/pyenv-installer
to install it.
Once that is done, change your python
command to whatever version of python you'd like it to point to.
Upvotes: 1