0
0

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 5 years have passed since last update.

ubuntuでVScodeでPython3使うときに困った話

0
Last updated at Posted at 2021-01-04

GCPを利用してubuntuを使えるようにしてみた。
使い慣れたVSCodeでpythonコードをgithubから落としてきたが、python3がそのままでは使えなかったのでメモ。

codeの左下にPythonのバージョンが表示されているのでクリックするとコマンドパレット(上側の検索バー)にpythonのバージョンが選択肢として表示される。
ココでpython3を選択すれば良いはずなのですが、、、ターミナルでpython --versionを打つと旧バージョンのpython2ですよと表示されます。

下記コマンドを打つとデフォルトを変更できるようです。
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 9

以下、参考サイトです。
https://qastack.jp/unix/410579/change-the-python3-default-version-in-ubuntu

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?