差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
python:python_install_xrea [2009/05/17 13:02] – ともやん | python:python_install_xrea [2019/08/19 07:01] (現在) – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== | + | ====== |
===== Python 2.6.2をソースからビルドする ===== | ===== Python 2.6.2をソースからビルドする ===== | ||
- sshにてログインする。< | - sshにてログインする。< | ||
行 5: | 行 6: | ||
username@sxxx.xrea.com' | username@sxxx.xrea.com' | ||
Last login: Sun May 17 08:44:04 2009 from xxxxx.xxxxx.co.jp | Last login: Sun May 17 08:44:04 2009 from xxxxx.xxxxx.co.jp | ||
- | username@sxxx: | + | $ |
</ | </ | ||
- 作業用のディレクトリを作成し移動する。< | - 作業用のディレクトリを作成し移動する。< | ||
- | username@sxxx: | + | $ mkdir tmp |
- | username@sxxx: | + | $ cd ~/tmp |
- | username@sxxx: | + | |
</ | </ | ||
- Pythonをダウンロードする。< | - Pythonをダウンロードする。< | ||
- | username@sxxx: | + | $ wget http:// |
--2009-05-17 11: | --2009-05-17 11: | ||
Resolving www.python.org... 82.94.164.162, | Resolving www.python.org... 82.94.164.162, | ||
行 26: | 行 26: | ||
</ | </ | ||
- 圧縮ファイルを展開する。< | - 圧縮ファイルを展開する。< | ||
- | username@sxxx: | + | $ tar xvjf Python-2.6.2.tar.bz2 |
Python-2.6.2/ | Python-2.6.2/ | ||
Python-2.6.2/ | Python-2.6.2/ | ||
行 33: | 行 33: | ||
</ | </ | ||
- Pythonをビルドするための準備をする。< | - Pythonをビルドするための準備をする。< | ||
- | username@sxxx: | + | $ cd Python-2.6.2 |
- | username@sxxx: | + | $ ./configure --prefix=/ |
checking for --with-universal-archs... 32-bit | checking for --with-universal-archs... 32-bit | ||
checking MACHDEP... linux2 | checking MACHDEP... linux2 | ||
行 41: | 行 41: | ||
</ | </ | ||
- Pythonをビルドする。< | - Pythonをビルドする。< | ||
- | username@sxxx: | + | $ make install |
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes | gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes | ||
-I. -IInclude -I./ | -I. -IInclude -I./ | ||
行 48: | 行 48: | ||
~省略~ | ~省略~ | ||
</ | </ | ||
+ | |||
===== 環境変数の設定 ===== | ===== 環境変数の設定 ===== | ||
- vi で ~/.bashrc を作成する。< | - vi で ~/.bashrc を作成する。< | ||
- | username@sxxx: | + | $ vi .bashrc |
</ | </ | ||
行 58: | 行 59: | ||
</ | </ | ||
- | ===== bash を起動して | + | ===== Python のバージョンを確認 ===== |
- | < | + | - bash を起動して python のバージョンを表示する。< |
- | username@sxxx: | + | $ bash |
- | username@sxxx: | + | $ python -V |
Python 2.6.2 | Python 2.6.2 | ||
</ | </ | ||
+ | |||
+ | ===== easy_install の導入 ===== | ||
+ | - ez_setup.py をダウンロードする。< | ||
+ | $ cd ~/tmp | ||
+ | $ wget http:// | ||
+ | wget http:// | ||
+ | --2009-05-17 14: | ||
+ | Resolving peak.telecommunity.com... 209.190.5.234 | ||
+ | Connecting to peak.telecommunity.com|209.190.5.234|: | ||
+ | HTTP request sent, awaiting response... 200 OK | ||
+ | Length: 9716 (9.5K) [text/ | ||
+ | Saving to: `ez_setup.py' | ||
+ | |||
+ | 100%[==============================================================================================> | ||
+ | |||
+ | 2009-05-17 14:40:47 (25.9 KB/s) - `ez_setup.py' | ||
+ | </ | ||
+ | |||
+ | - ez_setup.py を実行する。< | ||
+ | $ python ez_setup.py | ||
+ | ez_setup.py: | ||
+ | except ImportError: | ||
+ | Traceback (most recent call last): | ||
+ | File " | ||
+ | except ImportError: | ||
+ | File "/ | ||
+ | from hashlib import md5 | ||
+ | File "/ | ||
+ | md5 = __get_builtin_constructor(' | ||
+ | File "/ | ||
+ | import _md5 | ||
+ | ImportError: | ||
+ | </ | ||
===== 参考文献 ===== | ===== 参考文献 ===== | ||
[[http:// | [[http:// | ||