2012-10-28(Sun)
CentOS6.3へpythonbrewをインストール
python2.7.3とpytho3.2.3とを切り替えて使いたいのでpythonbrewをインストールしてみた。
pythonbrewはアカウントごとにインストールできるのでアカウントごとにversion管理でき便利だ。
インストールも簡単だがpython3.2.3にはバグが潜んでいるので注意が必要。
インストール
以下のスクリプトでインストールする。
動作確認
Python3.2.3へ切り替える
エラー発生!
pythonコマンドのリンクがうまくいってないので修正する。
確認
うまく動いた。
pythonbrewはアカウントごとにインストールできるのでアカウントごとにversion管理でき便利だ。
インストールも簡単だがpython3.2.3にはバグが潜んでいるので注意が必要。
インストール
以下のスクリプトでインストールする。
#!/bin/sh
cd /root/tools
# 1.pythonbrewのインストール
echo 'python brew'
curl -kLO https://github.com/utahta/pythonbrew/raw/master/pythonbrew-install
chmod +x pythonbrew-install
./pythonbrew-install
# 2.PATH追加
echo 'setting bashrc'
echo "export PATH=$PATH:/home/hoge/.pythonbrew/bin"
echo "[[ -s \"$HOME/.pythonbrew/etc/bashrc\" ]] && source \"$HOME/.pythonbrew/etc/bashrc\"" >> ~/.bashrc
source ~/.bashrc
# 3.python2.7.3インストール
echo 'python2.7.3'
pythonbrew install 2.7.3
echo 'python3.2.3'
pythonbrew install 3.2.3
動作確認
Python3.2.3へ切り替える
$ pythonbrew switch 3.2.3
バージョン確認
$ python -V
Usage: /home/hoge/.pythonbrew/pythons/Python-3.2.3/bin/python\
[--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags]
エラー発生!
pythonコマンドのリンクがうまくいってないので修正する。
$ cd /home/hoge/.pythonbrew/pythons/Python-3.2.3/bin
rm python
ln -s python3.2 python
確認
$ python -V
Python 3.2.3
うまく動いた。
- 関連記事
-
- pythonbrew上のpython3.2.3へpipのインストール
- CentOS6.3へpythonbrewをインストール
- CentOS6.3にPython2.7.3をインストール
スポンサーサイト