30
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

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

Posted at

linuxでPythonコマンドを入力するとデフォルトで指すのは/usr/bin/python2.7です。
使いやすいのため、[シンボリックリンク]を作成して、pythonコマンドはpython3を指す。
[シンボリックリンク]:https://ja.wikipedia.org/wiki/%E3%82%BD%E3%83%95%E3%83%88%E3%83%AA%E3%83%B3%E3%82%AF

##健忘症患者のメモ: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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?