4
0

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.

Python Version 変更する方法

Last updated at Posted at 2020-03-29

pythonを勉強している初心者です。
この記事は学習の目的として記録中です。
なので、参考にできる記事とか内容が間違ってたらコメントをよろしくお願いします。

開発環境

OS : macOS Catalina
Version : 10.15.3

Install可能なpython Version確認

$ pyenv install --list

Version確認

$ python  --version
Python 2.7.16

変更可能なpython Version確認

$ pyenv versions
  system
* 3.9.0 (set by /Users/******/.python-version)

※インストールされているバージョンにより、変更可能なVersionが異なります。

python変更可能なVersionに切り替え

pyenv global 3.9.0

変更されてるかを確認

$ python  --version
Python 2.7.16

えーーー!!
うまく行かない。。

その時は👇

追加コマンド

$ eval "$(pyenv init -)"

この仕組みについては参考記事をご覧ください。

変更されてるかを確認

$ python  --version
Python 3.9.0

できた〜!

参考記事

pyenvがバージョンを切り替える仕組みを理解する

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?