bojo
bojo

Reputation: 21

How to take care of Brew Doctor warning

As I was not able to change python version via pyenv global, I have re-install pyenv and python. And now I am getting this warning. Earlier I have fixed this issue by referring other articles, though I assume setting something wrong in .bash_profile making pyenv global not working. I am total new to this. Any help make me understand the warning and resolve the issue would be greatly appreciated. Thanks

Macbooks-MacBook-Pro:~ macbookpro$ brew doctor

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name. We found the following "config" scripts:

/Users/macbookpro/.pyenv/shims/python-config   
/Users/macbookpro/.pyenv/shims/python2-config   
/Users/macbookpro/.pyenv/shims/python2.7-config   
/Users/macbookpro/.pyenv/shims/python3-config   
/Users/macbookpro/.pyenv/shims/python3.6-config   
/Users/macbookpro/.pyenv/shims/python3.6m-config

Macbooks-MacBook-Pro:~ macbookpro$ which pyenv    /usr/local/bin/pyenv 
Macbooks-MacBook-Pro:~ macbookpro$ which brew   /usr/local/bin/brew   
Macbooks-MacBook-Pro:~ macbookpro$ pyenv versions   
 system  
  2.7.15  
* 3.6.5 (set by /Users/macbookpro/.python-version)  

Macbooks-MacBook-Pro:~ macbookpro$ open -e .bash_profile           
if which pyenv > /dev/null; then
  eval "$(pyenv init -)";
  fi   export PYENV_ROOT="$HOME/.pyenv"   export 
  PATH="$PYENV_ROOT/bin:$PATH"   eval "$(pyenv init -)"  

Macbooks-MacBook-Pro:~ macbookpro$ python --version   Python 3.6.5   
Macbooks-MacBook-Pro:~ macbookpro$ pyenv global 2.7.15
Macbooks-MacBook-Pro:~ macbookpro$ pyenv global                   
2.7.15 .                           
Macbooks-MacBook-Pro:~ macbookpro$ python --version              
Python 3.6.5    
Macbooks-MacBook-Pro:~ macbookpro$ which python                     /Users/macbookpro/.pyenv/shims/python

Upvotes: 1

Views: 917

Answers (2)

mklengel
mklengel

Reputation: 31

The alias can be improved:

alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'

Just in case $PATH contains spaces.

Upvotes: 3

Michael Gogel
Michael Gogel

Reputation: 303

Try adding the following alias to your source file

alias brew='env PATH=${PATH//$(pyenv root)/shims:/} brew'

Upvotes: 0

Related Questions