2019/11/26 Winds Chord Blogに移行しました。
CentOS 6.2にyumで入っているPythonのバージョンが2.6.6で少し古いので,2.7.2に更新する.
(2015/3/21追記 Python3.4のインストールはこちら)
1.インストールに必要なものをインストール
$ sudo yum install zlib zlib-devel tk-devel tcl-devel sqlite-devel ncurses-devel gdbm-devel readline-devel bzip2-devel db4-devel openssl-devel
(2012/12/31 openssl-devel追記)
2.Pythonをダウンロードして解凍する
$ wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
$ tar zxvf Python-2.7.2.tgz
3.インストール
$ ./configure --with-threads --enable-shared
#CentOSのPythonを残す場合には,--prefixオプションを付けて
#インストール先を指定してください.(2012/12/31追記)
# ./configure --with-threads --enable-shared --prefix=/usr/local
$ make
ここで_SSLのモジュールが無いと言われていたら,3.1を実施後に3.を再実行する.
それ以外のモジュールは下記参照で,必要であればインストールして3.を再実行.
http://www.kelvinwong.ca/2010/08/02/python-2-7-on-dreamhost/
3.1 ./Module/Setupををコメントアウトを外し,編集する.
SSL=/usr
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
(2012/12/31追記)
$ sudo make install
4.エラー対策(x86_64の場合)
ここで,実行すると
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
とエラーで動かない.コンパイルはされているので,シンボリックを貼る
$ ln -s /usr/local/lib/libpython2.7.so.1.0 /lib64/
5.確認
$ python
Python 2.7.2と表示されれば成功
参考
http://d.hatena.ne.jp/paraches/20110421
http://d.hatena.ne.jp/takayuki_goto/20110714/p1
http://d.hatena.ne.jp/shrkw/20110124/1295851744
http://masabossa.typepad.jp/microblog/2011/06/python-26%E3%81%A7ssl%E3%82%92%E6%9C%89%E5%8A%B9%E5%8C%96%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AEpython%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E6%89%8B%E9%A0%86.html
CentOS 6.2にyumで入っているPythonのバージョンが2.6.6で少し古いので,2.7.2に更新する.
(2015/3/21追記 Python3.4のインストールはこちら)
1.インストールに必要なものをインストール
$ sudo yum install zlib zlib-devel tk-devel tcl-devel sqlite-devel ncurses-devel gdbm-devel readline-devel bzip2-devel db4-devel openssl-devel
(2012/12/31 openssl-devel追記)
2.Pythonをダウンロードして解凍する
$ wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
$ tar zxvf Python-2.7.2.tgz
3.インストール
$ ./configure --with-threads --enable-shared
#CentOSのPythonを残す場合には,--prefixオプションを付けて
#インストール先を指定してください.(2012/12/31追記)
# ./configure --with-threads --enable-shared --prefix=/usr/local
$ make
ここで_SSLのモジュールが無いと言われていたら,3.1を実施後に3.を再実行する.
それ以外のモジュールは下記参照で,必要であればインストールして3.を再実行.
http://www.kelvinwong.ca/2010/08/02/python-2-7-on-dreamhost/
3.1 ./Module/Setupををコメントアウトを外し,編集する.
SSL=/usr
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
(2012/12/31追記)
$ sudo make install
4.エラー対策(x86_64の場合)
ここで,実行すると
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
とエラーで動かない.コンパイルはされているので,シンボリックを貼る
$ ln -s /usr/local/lib/libpython2.7.so.1.0 /lib64/
5.確認
$ python
Python 2.7.2と表示されれば成功
参考
http://d.hatena.ne.jp/paraches/20110421
http://d.hatena.ne.jp/takayuki_goto/20110714/p1
http://d.hatena.ne.jp/shrkw/20110124/1295851744
http://masabossa.typepad.jp/microblog/2011/06/python-26%E3%81%A7ssl%E3%82%92%E6%9C%89%E5%8A%B9%E5%8C%96%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AEpython%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E6%89%8B%E9%A0%86.html
Hop aboard and luxuriate in an intergalactic space-themed journey slot. If nothing else, the revelation that a seventh bidder has entered the race for a Macau 카지노 gaming concession under the... It's great if you can hold monitor of time and the way much cash you spend each day.
返信削除