Python version does not switch

When I tried to upgrade the pre-installed 2.X python to 3.x, I got stuck a little, so make a note.

Try changing the version

Install and confirm new version

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

After creating a new directory, switch the version with the local option there. I didn't mean it. ..

$ pyenv local 3.6.0
$ python -V
Python 2.7.10

approach

Add the following to ~ / .bash_profile

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

Apply .bash_profile

source ~/.bash_profile

Now that Path has passed, the version has been switched successfully!

$ python -V
Python 3.6.0

Recommended Posts

Python version does not switch
Check when the version does not switch with pyenv
What to do if Python does not switch from the System version in pyenv
[VScode] autopep8 format does not work [Python]
Switch Python versions
Virtualenv does not work on Python3.5 (Windows)
Python> Python does not include the last offset
SciPy version does not go up (Mac)
PYTHON2.7 64bit version
Opencv4.1 + Windows10 + Python 3.7.5 cv2.VideoCapture does not display correctly
Jinja2 2.9.6 does not work on Lambda Python 3 series
[Python] Expression (1,2) does not make tuples with parentheses
python Boolean operation does not return a Boolean value
Python Not Implemented Error
Python version switching (pyenv)
Examples and solutions that the Python version specified in pyenv does not run
Check version with python
Key input that does not wait for key input in Python
Python round is not strictly round
[Python] Reason why index error does not occur in slice
filter rollbar python 404 not found
Breadth-first search / bidirectional search (Python version)
Petit stray Python version output
Change python version using pyenv
Version upgrade of python Anaconda
Python list is not a list
Python error support note: "... does not support argument 0 of type float ..."
Check OpenSSL version of python 2.6
Switch from python2.7 to python3.6 (centos7)
Switch python to 2.7 with alternatives
[Python] Not just count collections.Counter
Introduction to Python (Python version APG4b)
How to change Python version
Specify python version with virtualenv
Does python inherit special methods?
distutils log does not appear
tesseract-OCR for Python [Japanese version]
Error resolution python version check
The story that the version of python 3.7.7 was not adapted to Heroku
Solution when background-cover of Linux version VS Code does not work
Tkinter canvas (window) does not start when running Python 3.7.4 with Atom
A special Python codec that seems to know but does not know
[Python] Tuple version of prefecture pull-down
Virtual Environment Version Control Summary Python
Do not switch with pyenv global!
[Centos8] logrotate does not start properly
Anaconda and Python version correspondence table
Install xgboost (python version) on Windows
pyenv-change the python version of virtualenv
Problem that discord.py does not break
Ideone> Python version: 3.5 (as of August 29, 2017)
How to get the Python version
[Code] Module and Python version output
Change the Python version of Homebrew
Master linear search! ~ Python implementation version ~
LocateCenterOnScreen does not work on PyAutoGui
There is no switch in python
Jupyter does not show matplotlib graph
[2021 version] Python installation Windows 10 (64bit) edition
str.replace does not replace escape characters
Manage each Python version with Homebrew