0
1

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 3 years have passed since last update.

Mac OSにpyenvをHomebrewを使ってインストールしたけど、pythonのバージョンが切り替わらないときの対処法

Last updated at Posted at 2020-07-07

問題

mac osでHomebrew(パッケージ管理ツール)を使って、pyenvをインストールし、pythonのバージョンをglobalに設定してみたけど、pythonのバージョンが切り替わらない。


$ brew install pyenv # pyenvのインストール
$ pyenv install 3.8.0 # pythonのバージョンのインストール
$ pyenv global 3.8.0 # pythonのバージョンをglobalに設定
$ python -V # バージョンを確認
2.7.7 # デフォルトのバージョンと変わらない問題

解決法

ホームディレクトリの.bash_profileまたは.zshrcにeval "$(pyenv init -)"を加え、sourceコマンドで適応させる

$ vim .zshrc
$ source .zshrc
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?