LoginSignup
23
20

More than 1 year has passed since last update.

bashrcでPythonのバージョンを指定する方法

Posted at

はじめに

たまに使うので備忘録として残しておきます。

bashrcとは

bashを起動したときに読み込まれる設定ファイルです。

方法

$ python -V
Python 3.7.3
$ sudo vim ~/.bashrc

bashrcを開いて、以下を追記します。

bashrc
alias python=python3.8

以下のコマンドで設定を反映させます。

$ source ~/.bashrc

反映されているかどうか確認してみます。

$ python -V
Python 3.8.0

無事変更されました。

23
20
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
23
20