LoginSignup
1
0

More than 1 year has passed since last update.

Windows PC へのPython3 導入手順

Last updated at Posted at 2022-04-13

1.はじめに

Windows10 の環境に Python3 を導入します。

※ Mac PCへの Python3 導入手順は、以下リンク先をご参照ください。

・Qiita:Mac PC へのPython3 導入手順
https://qiita.com/Haruka-Ogawa/items/b1bf5ad9b28d44702a64

2. Python3 導入

① ダウンロード

まず、公式サイトからPythonを ダウンロードします。
最新版は以下リンク先を開くと取得することができます。

・Python:Download the latest version for Windows
https://www.python.org/downloads/

image.png

今回は Python 3.10.4 をダウンロードします。
[Download Python 3.10.4]ボタンをクリックすると、ダウンロードが開始されます。

image.png

② インストール

Python のインストールを行います。

ダウンロードされたexeファイルを実行すると、以下のような画面が表示されます。

image.png

導入後 Pythonを使用するには PATHを設定する必要があります。
手動でPATHを設定しても良いですが、
ここではあらかじめ [Add Python 3.10 to PATH]にチェックを入れて、インストール時にPATHを設定するようにしておきます。

image.png

[Install Now]をクリックすると、インストールが開始されます。

image.png

image.png

[Setup was successfull] 画面が表示されたら、[Close]ボタンをクリックして 画面を閉じます。

image.png

③ 確認

Python 3.10.4 の導入が完了したら、
コマンドプロンプトを起動して Pythonのバージョンを確認し、無事導入されていることを確認します。

コマンドは以下の通りです。

python -V

実行例は以下の通りです。

C:\>python -V
Python 3.10.4

Python 3.10.4 が導入されたことが確認できました。

さらに、コマンドプロンプトでpythonコマンドを実行すると、
対話モードが開始されて、様々な処理を実行することができます。

C:\>python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello world")
hello world

対話モードを終了する場合は、quit() を入力します。

>>> quit()

C:\>

3. おわりに

今回は、Windows PC への Python 導入を行いました。

Python導入には 他にも方法がありますが、exeファイルを実行する方法が 最も簡単で手っ取り早いです。

以前の記事 Mac PC へのPython3 導入手順では、Python3の導入にpyenvを使用しましたが、
Windows PCでも pyenv(pyenv-win)を使用することが可能です。

pyenvでは、Pythonのバージョンを管理することができ、
複数バージョンを切り替えて使用したい場合は、pyenvの使用を検討するとよいと思われます。

参考情報

・Python.jp プログラミング言語 Python情報サイト:Windows版Pythonのインストール
https://www.python.jp/install/windows/install.html

1
0
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
1
0