Did not change from Python 2 to 3

Not changed from python2 to 3 ...

$ python --version
Python 2.7.15

$ brew install python3
$ python3 --version
-bash: python3: command not found

Oh, python3 is not installed ...

Solution?

#Install python3
$ brew install python3
Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.1 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.1
Ignoring byebug-10.0.2 because its extensions are not built.  Try: gem pristine byebug --version 10.0.2
Ignoring byebug-9.0.6 because its extensions are not built.  Try: gem pristine byebug --version 9.0.6
Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.1 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.1
Ignoring byebug-10.0.2 because its extensions are not built.  Try: gem pristine byebug --version 10.0.2
Ignoring byebug-9.0.6 because its extensions are not built.  Try: gem pristine byebug --version 9.0.6
Warning: python 3.7.6_1 is already installed, its just not linked
You can use `brew link python` to link this version.

$ brew link python
Linking /usr/local/Cellar/python/3.7.6_1...
Error: Could not symlink Frameworks/Python.framework/Headers
Target /usr/local/Frameworks/Python.framework/Headers
is a symlink belonging to python@2. You can unlink it:
  brew unlink python@2

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

#try unlink
$ brew unlink python@2
Unlinking /usr/local/Cellar/python@2/2.7.15_1... 39 symlinks removed
$ brew link python
Linking /usr/local/Cellar/python/3.7.6_1... 28 symlinks created

#Verification
$ python3 --version
Python 3.7.6

Does it look like python3 is installed properly?

Recommended Posts

Did not change from Python 2 to 3
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
What I did when updating from Python 2.6 to 2.7
Post from Python to Slack
Cheating from PHP to Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
How to change Python version
[Python] Change standard input from keyboard to text file
Call Matlab from Python to optimize
Post from python to facebook timeline
[Lambda] [Python] Post to Twitter from Lambda!
Change python default encoding to utf-8
Connect to utf8mb4 database from python
Python (from first time to execution)
How to access wikipedia from python
[Python] Change the alphabet to numbers
Update Python on Mac from 2 to 3
[Python] How to get & change rows / columns / values from a table.
Change the active version in Pyenv from anaconda to plain Python
[It's not too late to learn Python from 2020] Part 3 Python Language Basic (1)
[Python] Fluid simulation: From linear to non-linear
Change Python 64bit environment to 32bit environment with Anaconda
From Python to using MeCab (and CaboCha)
How to update Google Sheets from Python
Send a message from Python to Slack
Private Python handbook (updated from time to time)
Convert from katakana to vowel kana [python]
Push notification from Python server to Android
Connecting from python to MySQL on CentOS 6.4
Porting and modifying doublet-solver from python2 to python3.
How to access RDS from Lambda (python)
Python> Output numbers from 1 to 100, 501 to 600> For csv
Convert from Markdown to HTML in Python
[Amazon Linux] Switching from Python 2 series to Python 3 series
API explanation to touch mastodon from python
Python http.server did not support Range Request
Connect to coincheck's Websocket API from Python
What I did to save Python memory
Updated to Python 2.7.9
Sum from 1 to 10
sql from python
MeCab from Python
"Backport" to python 2
Edit Excel from Python to create a PivotTable
How to open a web browser from python
[Python] How to change the date format (display format)
[Python] Convert from DICOM to PNG or CSV
[Python] What I did to do Unit Test
I want to email from Gmail using Python.
[Python] I want to manage 7DaysToDie from Discord! 1/3
From file to graph drawing in Python. Elementary elementary
[Python] How to read data from CIFAR-10 and CIFAR-100
[python] Create table from pandas DataFrame to postgres
[Bash] Use here-documents to get python power from bash
How to generate a Python object from JSON
Command operation to not move from home position
[Python] Flow from web scraping to data analysis
I want to use ceres solver from python