LoginSignup
4
5

More than 5 years have passed since last update.

[備忘]pyenvインストール後の.bash_profileの設定

Posted at

はじめに

ググっても解になかなかたどり着けなかっったので、備忘として残す
同じことで止まってしまった人の助けになれば幸い

事象

pyenvをインストールし、一緒にインストールしたanacondaなどにpyenvからバージョンの切り替えをしたが、pythonのバージョンが変わっていなかった

対処

.bash_profileに以下の設定が必要だった

参考
python入門 - python3系からのまとめ

before

$ python --version
Python 2.7.10

.bash_profileの設定

$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source .bash_profile

after

$ python --version
Python 3.5.2 :: Anaconda 4.2.0 (x86_64)
4
5
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
4
5