0
0

More than 3 years have passed since last update.

Python2から3に変更されなかった

Posted at

python2から3に変更されない...

$ python --version
Python 2.7.15

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

あれ、python3がインストールされてない...

解決?

# 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

# 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

# 確認
$ python3 --version
Python 3.7.6

python3がきちんとインストールされたっぽい?

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