差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
python:install_xrea [2009/05/17 12:38] – ともやん | python:python_install_xrea [2019/07/27 07:13] – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Python インストール(Xrea編) ====== | + | <ifauth !@loggedinusers>< |
+ | <script async src="// | ||
+ | < | ||
+ | | ||
+ | google_ad_client: | ||
+ | enable_page_level_ads: | ||
+ | }); | ||
+ | </ | ||
+ | ====== Python | ||
- | | + | ===== Python 2.6.2をソースからビルドする ===== |
- | < | + | |
$ ssh username@sxxx.xrea.com | $ ssh username@sxxx.xrea.com | ||
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: | + | $ |
</ | </ | ||
- | + | - 作業用のディレクトリを作成し移動する。< | |
- | 作業用のディレクトリを作成し移動する。 | + | $ mkdir tmp |
- | < | + | $ cd ~/tmp |
- | username@sxxx: | + | |
- | username@sxxx: | + | |
- | username@sxxx: | + | |
</ | </ | ||
- | + | - Pythonをダウンロードする。< | |
- | Pythonをダウンロードする。 | + | $ wget http:// |
- | < | + | |
- | username@sxxx: | + | |
--2009-05-17 11: | --2009-05-17 11: | ||
Resolving www.python.org... 82.94.164.162, | Resolving www.python.org... 82.94.164.162, | ||
行 30: | 行 33: | ||
2009-05-17 11:56:40 (1.02 MB/s) - `Python-2.6.2.tar.bz2' | 2009-05-17 11:56:40 (1.02 MB/s) - `Python-2.6.2.tar.bz2' | ||
</ | </ | ||
- | + | - 圧縮ファイルを展開する。< | |
- | 圧縮ファイルを展開する。 | + | $ tar xvjf Python-2.6.2.tar.bz2 |
- | < | + | |
- | username@sxxx: | + | |
Python-2.6.2/ | Python-2.6.2/ | ||
Python-2.6.2/ | Python-2.6.2/ | ||
行 39: | 行 40: | ||
~省略~ | ~省略~ | ||
</ | </ | ||
- | + | - Pythonをビルドするための準備をする。< | |
- | Pythonをビルドするための準備をする。 | + | $ cd Python-2.6.2 |
- | < | + | $ ./configure --prefix=/ |
- | username@sxxx: | + | |
- | username@sxxx: | + | |
checking for --with-universal-archs... 32-bit | checking for --with-universal-archs... 32-bit | ||
checking MACHDEP... linux2 | checking MACHDEP... linux2 | ||
行 49: | 行 48: | ||
~省略~ | ~省略~ | ||
</ | </ | ||
- | + | - Pythonをビルドする。< | |
- | Pythonをビルドする。 | + | $ make install |
- | < | + | |
- | username@sxxx: | + | |
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./ | ||
行 59: | 行 56: | ||
~省略~ | ~省略~ | ||
</ | </ | ||
+ | |||
+ | ===== 環境変数の設定 ===== | ||
+ | - vi で ~/.bashrc を作成する。< | ||
+ | $ vi .bashrc | ||
+ | </ | ||
+ | |||
+ | * ~/ | ||
+ | export PYTHONPATH=~/ | ||
+ | export PATH=" | ||
+ | </ | ||
+ | |||
+ | ===== Python のバージョンを確認 ===== | ||
+ | - bash を起動して python のバージョンを表示する。< | ||
+ | $ bash | ||
+ | $ python -V | ||
+ | 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:// | ||