Help us understand the problem. What is going on with this article?

pyenvを使って、pythonバージョンの変更

More than 3 years have passed since last update.

参考:pyenvとvirtualenvで環境構築

インストール出来るバージョンの確認


% pyenv install --list

それぞれのバージョンのpythonのインストール


$ pyenv install 3.5.0

$ pyenv install 2.7.10

切り替えられるpythonのバージョンの確認

% pyenv versions  
  system  
  2.7.10  
* 3.5.0 (set by /Users/xxx/.pyenv/version)  

現在のバージョンの確認

% python --version                        
Python 3.5.0

pythonのバージョンの切り替え

globalとすると全体に、localにするとそのカレントディレクトリに指定したバージョンが反映されます。

$ pyenv global 3.5.0
$ python --version
Python 3.5.0

$ pyenv local 2.7.10
$ python --version
Python 2.7.10
twipg
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした