LoginSignup
101
58

More than 5 years have passed since last update.

pythonのバージョンが切り替わらない

Last updated at Posted at 2017-02-18

プリインストールされている2.Xのpythonを、3.xにバージョンアップしようと思ったところ、少し引っかかったのでメモ。

バージョンを変更してみる

新しいバージョンをインストール、確認


$ pyenv install 3.6.0
$ pyenv versions
system
* 3.6.0 (set by ・・・・

新しくディレクトリを作成後、そこでlocalオプションでバージョン切り替え。
のつもりがうまくいかず。。

$ pyenv local 3.6.0
$ python -V
Python 2.7.10

対処法

~/.bash_profileに以下を追記


export PATH="$HOME/.pyenv/shims:$PATH"

.bash_profileを適用

source ~/.bash_profile

これでPathが通ったので無事バージョンが切り替えられました!

$ python -V
Python 3.6.0
101
58
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
101
58