python:python_install

文書の過去の版を表示しています。


Python のインストール

ここでは pythonbrew を使って 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
  1. Welcome to Python.orgDownload Python | Python.orgより最新バージョンをダウンロードしてくる。(ここでは python-3.7.4-amd64.exe を使用する。)
  2. ダウンロードした python-3.7.4-amd64.exe を実行して、[Customize installation] をクリックする。
  3. Advanced Options の [v]Install for all users にチェックを入れて Customize install location を C:\Python37 に変更する。(お好みで…)
  4. [Install] をクリックする。
  5. インストールが終わったら [Disable path length limit] をクリックしておく。
  6. タスクバーの「ここに入力して検索」に sysdm.cpl を入力して Enter キーを押す。
  7. 「システムのプロパティ」の「詳細設定」タブの[環境変数]ボタンを押して「環境変数」画面を開く。
  8. システム環境変数の PATH に Python のフォルダ(C:\Python37;C:\Python37\Scripts;)を追加する。
    PATH:
    C:\Python37;C:\Python37\Scripts;C:\Program Files...
  9. コマンドラインにて動作確認を行う。
    > python -V
    Python 3.7.4
  • python/python_install.1564169757.txt.gz
  • 最終更新: 2019/07/27 04:35
  • by ともやん