LoginSignup
2
2

More than 5 years have passed since last update.

Python インストール

Last updated at Posted at 2017-12-14

インストール

Ubuntuは作業の必要なし。
プリインストールされているので、最初から使えます。
最小限の確認手順は下記のみ。

# python -V
Python 2.7.12

対話型シェルで動作確認する場合は下記でできます。

# python
Python
>>>print 'Python'
Python

Ctrl+Dでシェル終了。

以下は利用している環境確認とVersion3の追加、使い分けを記載します。

インストール環境

CPU:64bit
OS:Ubuntu / OSバージョン:随時最新

補足:CPU確認方法

# uname -m
x86_64

補足:OSバージョン確認方法

# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"

その他Linux系はyumなどでインストールしたり、ソースからコンパイルしたりします。
WindwosはPythonのサイトにインストーラがあります。

バージョン2と3の使い分け

バージョン3のインストール

# apt install python3
# python3 -V
Python 3.5.2

バージョン2と3の使い分け

# python2 xxx.py

補足:python xxx.pyとした場合はバージョン2が動作します。

# python3 xxx.py

インデックス

次回:pyファイルの書き方

Topのインデックスに戻る

2
2
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
2
2