LoginSignup
8
10

More than 5 years have passed since last update.

Macにpyenvを入れたらbrew doctorで怒られるようになったので対応したメモ

Posted at

Ansibleの1.9系と2.0系を両方使いたくてpyenvを導入したらHomebrewに怒られた。

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

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/tsukapah/.pyenv/shims/python-config
  /Users/tsukapah/.pyenv/shims/python2-config
  /Users/tsukapah/.pyenv/shims/python2.7-config

PATHが通ってるところとかHomebrew関連のディレクトリに管理外の*-configが悪影響及ぼすかもしれないからどうにかしてねー、って感じでしょうか。

実際にPATHはこうなってた。

$ echo ${PATH}
/Users/tsukapah/.pyenv/shims:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

しっかり先頭にいる。
ファイル消すわけにもいかんしPATHをどうにかする方向で検討。

brewコマンドを使うときだけpyenv用のPATHが通らなくなればいいので、brewコマンドのaliasを以下の感じで.bash_profileの最後に設定しておけば解決。

alias brew="env PATH=${PATH/\/Users\/${USER}\/\.pyenv\/shims:/} brew"

あとはこの.bash_profileを読み込み直してあげればHomebrewの機嫌も直ってメデタシ。

8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10