目次
文書の過去の版を表示しています。
Python のインストール
Linux & Mac 編
ここでは pythonbrew を使って python をインストールします。
python のインストール
python 2.7.3 をインストールする。
$ pybrew install 2.7.3 Downloading Python-2.7.3.tgz as /Users/tomoyan/.pythonbrew/dists/Python-2.7.3.tgz ######################################################################## 100.0% Extracting Python-2.7.3.tgz into /Users/tomoyan/.pythonbrew/build/Python-2.7.3 This could take a while. You can run the following command on another shell to track the status: tail -f "/Users/tomoyan/.pythonbrew/log/build.log" Patching Python-2.7.3 Installing Python-2.7.3 into /Users/tomoyan/.pythonbrew/pythons/Python-2.7.3 Downloading distribute_setup.py as /Users/tomoyan/.pythonbrew/dists/distribute_setup.py ######################################################################## 100.0% Installing distribute into /Users/tomoyan/.pythonbrew/pythons/Python-2.7.3 Installing pip into /Users/tomoyan/.pythonbrew/pythons/Python-2.7.3 Installed Python-2.7.3 successfully. Run the following command to switch to Python-2.7.3. pythonbrew switch 2.7.3
python を切り替える
$ pybrew switch 2.7.3 Switched to Python-2.7.3 $ python -V Python 2.7.3
python 3.2.3 をインストールする。
$ pybrew install 3.2.3 Downloading Python-3.2.3.tgz as /Users/tomoyan/.pythonbrew/dists/Python-3.2.3.tgz ######################################################################## 100.0% Extracting Python-3.2.3.tgz into /Users/tomoyan/.pythonbrew/build/Python-3.2.3 This could take a while. You can run the following command on another shell to track the status: tail -f "/Users/tomoyan/.pythonbrew/log/build.log" Installing Python-3.2.3 into /Users/tomoyan/.pythonbrew/pythons/Python-3.2.3 Downloading distribute_setup.py as /Users/tomoyan/.pythonbrew/dists/distribute_setup.py ######################################################################## 100.0% Installing distribute into /Users/tomoyan/.pythonbrew/pythons/Python-3.2.3 Installing pip into /Users/tomoyan/.pythonbrew/pythons/Python-3.2.3 Installed Python-3.2.3 successfully. Run the following command to switch to Python-3.2.3. pythonbrew switch 3.2.3
python を切り替える
$ pybrew switch 3.2.3 Switched to Python-3.2.3 $ python -V Python 3.2.3
Windows 編
- Welcome to Python.orgのDownload Python | Python.orgより最新バージョンをダウンロードしてくる。(ここでは python-3.7.4-amd64.exe を使用する。)
- ダウンロードした python-3.7.4-amd64.exe を実行して、[Customize installation] をクリックする。
- Advanced Options の [v]Install for all users にチェックを入れて Customize install location を C:\Python37 に変更する。(お好みで…)
- [Install] をクリックする。
- インストールが終わったら [Disable path length limit] をクリックしておく。
- タスクバーの「ここに入力して検索」に sysdm.cpl を入力して Enter キーを押す。
- 「システムのプロパティ」の「詳細設定」タブの[環境変数]ボタンを押して「環境変数」画面を開く。
- システム環境変数の PATH に Python のフォルダ(C:\Python37;C:\Python37\Scripts;)を追加する。
PATH:
C:\Python37;C:\Python37\Scripts;C:\Program Files...
- コマンドラインにて動作確認を行う。
> python -V Python 3.7.4