$ python --version
Python 2.7.15
$ brew install python3
$ python3 --version
-bash: python3: command not found
Oh, python3 is not installed ...
#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