いつのまにかPythonが3.10になっていたのでインストールする回。
ついでにVSCodeのインストールとか設定を残しておこうという魂胆。
Python3.10のインストール
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_001_2.jpg)
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_002.jpg)
インストールが開始されます。そのまま待機。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_003.jpg)
インストールが完了するとこんな画面が表示される。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_004.jpg)
Pythonの動作確認
ちゃんとインストールできているかコマンドプロンプトでPythonを起動してみます。
「cmd」と入力してEnterキーを押すと、コマンドプロンプトが起動します。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_006.jpg)
こんな感じでPythonが実行されてメッセージが表示されていればOK。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/python3.10_008.jpg)
Visual Studio Code のインストール
VisualStudioCodeのダウンロードページから最新のインストーラーをダウンロード
この記事を書いている時点の最新バージョンは「1.67.2」でした。
![](https://code.visualstudio.com/opengraphimg/opengraph-home.png)
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_002.jpg)
赤枠のボタンを押すと自動でインストーラーのダウンロードが開始されます。
ダウンロードしたインストーラーを実行
「同意する」を選択して「次へ」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_003.jpg)
「次へ」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_004.jpg)
「次へ」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_005.jpg)
お好みで「デスクトップ上にアイコンを作成する」にチェック
(デスクトップにVSCodeのショートカットができる)
「次へ」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_006.jpg)
「インストール」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_007.jpg)
インストールがはじまる。ちょっと待つ
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_008.jpg)
「完了」をクリックするとVisual Studio Codeが起動する
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_009.jpg)
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_010.jpg)
Visual Studio Code の日本語化
- 左側の「Extentions」アイコンを選択
- 検索ボックスに「Japanese」と入力
- でてきた「Japanese Language Pack for Visual Studio Code」の「Install」ボタンをクリック
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install-Japanese_001.jpg)
Visual Studio Codeを再起動すると日本語に切り替わる。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install-Japanese_002.jpg)
![VSCodeのメニューの「View」の中の「Command Palette」をクリック](https://yaspage.com/yasunolog/wp-content/uploads/2023/02/001-min.jpg)
![「Configure Display Language」を選択](https://yaspage.com/yasunolog/wp-content/uploads/2023/02/002-min.jpg)
![「日本語」を選択](https://yaspage.com/yasunolog/wp-content/uploads/2023/02/003-min.jpg)
![VSCodeを再起動](https://yaspage.com/yasunolog/wp-content/uploads/2023/02/004-min.jpg)
Visual Studio CodeのPython環境設定
- 左側の「拡張機能」アイコンを選択
- 検索ボックスに「Python」と入力
- 発行元は「Microsoft」なのを確認して「インストール」
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install-Japanese_003.jpg)
VSCodeでPythonを実行してみる
- 左側の「エクスプローラー」アイコンを選択して、「フォルダーを開く」をクリックしてフォルダを選択
※あらかじめPythonのソースファイルを格納するフォルダを作っておく
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_001.jpg)
エクスプローラーのエリア内で右クリックして「新しいファイル」を選択
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_002.jpg)
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_003.jpg)
ファイル名を「~.py」にしてPythonのソースファイルを作成
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_004.jpg)
作成されたファイルにテストコードをデバッグ実行してみる。
・左側の「実行とデバッグ」アイコンを選択して、「実行とデバッグ」ボタンをクリック
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_005.jpg)
なんかリストを選択しなさいって感じになるので「Python File」を選択。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_006.jpg)
下のターミナルに実行結果が出力される!!!!!、はず。
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCode-Install_Test_007.jpg)
まとめ
とりあえずここまで。
VSCodeの「実行とデバッグ」設定(launch.json)をしてみた記事はこちら、
![](https://yaspage.com/yasunolog/wp-content/uploads/2023/01/VSCodePythonlaunch-300x158.jpg)
コメント