4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

brew update でPython環境がおかしくなったので雑に解消メモ

Posted at

問題

homebrewですでにPython2.XとPython3.X系入ってた場合に、
brew update をすると python3 のエイリアスが python2.X系に向いてしまう

$ brew list python
/usr/local/Cellar/python/2.7.13/bin/2to3
/usr/local/Cellar/python/2.7.13/bin/2to3-2
-----(ry
$ brew list python3
/usr/local/Cellar/python/2.7.13/bin/2to3
/usr/local/Cellar/python/2.7.13/bin/2to3-2
-----(ry

python3 なのに python2.X を向いてるとは…。

解決

brew upgrade python で 2.X系のやつを3.X系で上書きしてしまう

$ brew upgrade python
==> Upgrading 1 outdated package, with result:
python 3.6.4_3
==> Upgrading python 
-----(ry
$ brew list python
/usr/local/Cellar/python/3.6.4_3/bin/2to3
/usr/local/Cellar/python/3.6.4_3/bin/2to3-3.6
/usr/local/Cellar/python/3.6.4_3/bin/easy_install
-----(ry

雑に解消したけども、
Pythonで複数バージョン使用したりするなら pyenvvenv 使うのがベターだと思います

4
4
1

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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?