CentOS5.3ã«Python2.6ã§Django1.1ã®éçºç°å¢ãä½æãã
CentOSã§ã¯Pythonã2.4ã¨å°ã
å¤ãããã·ã¹ãã ã§Pythonã«ä¾åãã¦ããç®æãå¤ãããã©ã«ãã®Pythonãç½®ãæããã®ã¯å¥½ã¾ãããªãã
ããã§/opt/python2.6ã«ã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ããDjangoã§éçºãåºæ¥ãæã¾ã§ã®æé ã¡ã¢ã
è¨å®ã¨ã´ã¼ã«
æºå - yum
sudo yum install zlib zlib-devel sqlite-devel
- zlibã¯setuptoolsã®ã¤ã³ã¹ãã¼ã«ã§å¿ è¦ã¨ãªãã
- sqlite3-develãã¤ã³ã¹ãã¼ã«ãã¦ãããªãã¨ãPython2.6ã®ã³ã³ãã¤ã«æã«sqlite3ã使ããããã«ãªããªã
Pythonã®ãã¦ã³ãã¼ãã¨ã¤ã³ã¹ãã¼ã«
$ wget http://python.org/ftp/python/2.6.2/Python-2.6.2.tgz
$ tar xvfz Python-2.6.2.tgz
$ cd Python-2.6.2
å¾ã¯ã./configure / make / make install ã®æé ã§ã¤ã³ã¹ãã¼ã«ããã
$ ./configure --prefix=/opt/python2.6 --with-threads --enable-shared
- ã¤ã³ã¹ãã¼ã«ãããã¹ã/opt/python2.6ã«æå®
- ãã¤ãããã¯ãªã³ã¯ã©ã¤ãã©ãªã¨ãã
ããã©ã«ãã§ã¯zlibã«å¯¾å¿ãã¦ããªããããModules/Setupãä¿®æ£ã
$ vi Modules/Setup # 次ã®è¡ã®ã³ã¡ã³ããå¤ã zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
å¾ã¯makeãã¦ã¤ã³ã¹ãã¼ã«ããã°OK
$ make $ sudo make install
å ±æã©ã¤ãã©ãªã®ãã¹ã追å ãã
$ vi /etc/ld.so.conf.d/opt-python2.6.conf
次ã®1è¡ãè¨è¿°
/opt/python2.6/lib
åæ
$ sudo /sbin/ldconfig
éçºã¦ã¼ã¶ã®pythonã³ãã³ããPython2.6ã«ãã
ã¨ãããããã·ã³ããªãã¯ãªã³ã¯ãä½æãã¦ãã
$ sudo ln -s /opt/python2.6/bin/python /usr/bin/python2.6
.bash_profileã§ãã¹ã«è¿½å
PATH=$PATH:$HOME/bin:/opt/python2.6/bin/
.bashrcãä¿®æ£ããaliasãè¨å®
alias python='python2.6'
åä½ç¢ºèª
$ source ~/.bash_profile $ source ~/.bashrc $ python2.6 -V Python 2.6.2 $ python Python 2.6.2 (r262:71600, Sep 6 2009, 20:30:58) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3
sqlite3ã§ã¤ã³ãã¼ãã®ã¨ã©ã¼ãçºçããå ´åã¯ãsqlite3-develãã¤ã³ã¹ãã¼ã«ãã¦makeããªãããã¨ã
Seuptoolsã®ã¤ã³ã¹ãã¼ã«
$ wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
$ sudo sh setuptools-0.6c9-py2.6.egg --prefix=/opt/python2.6
zlibã¨ã©ã¼ã®å ´åã¯ãzlib-develãã¤ã³ã¹ãã¼ã«ãã¦makeããªãããã¨ã
Django ã®ã¤ã³ã¹ãã¼ã«
$ sudo easy_install Django
æçµç¢ºèª
$ django-admin.py --version
1.1