LoginSignup
30
14

More than 3 years have passed since last update.

pythonコマンドでpythonはpython3.8を指す

Posted at

linuxでPythonコマンドを入力するとデフォルトで指すのは/usr/bin/python2.7です。
使いやすいのため、シンボリックリンクを作成して、pythonコマンドはpython3を指す。

健忘症患者のメモ:head_bandage:

#pythonのバージョンを表示
$ python -V
Python 2.7

#元のシンボリックリンクを削除
$ sudo rm -rf /usr/bin/python

#python関連ファイルを検索
$ whereis python
python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python3.6.5 /usr/bin/python3.8.5 

#シンボリックリンクを作成
$ sudo ln -s /usr/bin/python3.8 /usr/bin/python

#pythonのバージョンを表示
$ python -V
Python 3.8.5

pipも同じです~~

30
14
1

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
30
14