Mac ã«Pythonç°å¢æ´ãã¦ã¿ã
ã¨ã¯è¨ã£ã¦ããæ®éã«ã¤ã³ã¹ãã¼ã«ããã ããªã®ã§ãæ¬æ¥ãªãæ¸ããã¨ããã¾ããªãã
Python èªä½ã2.5 ã¯ããã©ã§å
¥ã£ã¦ãã®ã§ã2.6 以ä¸æ¬²ãã人åãã
ã¤ã³ã¹ãã¼ã©ã®æåãæ°ã«ãªã£ããã³ã§ããããæ¸ãã¦ã¿ãã
Python ã¤ã³ã¹ãã¼ã«(Python å ¬å¼)
ä½ã®ãã¨ã¯ãªããPython ããã¤ã³ã¹ãã¼ã©è½ã¨ãã¦å®è¡ããã ãã
æ°ã«ãªã£ãç¹ã¨ãã¦ãããã©ã«ãã® python ã®ãã¹ãæ°ã«ãªã£ãã®ã§ãã¤ã³ã¹ãã¼ã«å¾ã«ãwhereis ããã¦ã¿ãã¨ã¯ãã¿ã
$python --version Python 2.6.2 $whereis python /usr/bin/python $ls -l /usr/bin/python lrwxr-xr-x 1 root wheel 60 4 30 17:08 /usr/bin/python -> /usr/bin/python2.5
ãããï¼ï¼ãã¨æã£ã¦ãã.profileãéããã以ä¸ã®è¨è¿°ããããã
# Setting PATH for MacPython 2.6 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}" export PATH
ãªãã»ã©ã/usr/bin ãããªã㦠path ã«å²ãè¾¼ãã§ãã®ããããã
åé¡èµ·ããã¨ãã ããã/usr/bin ã®ãã¤ãæ¸ãæãã¦ããã*1
äºåã« rm ãã¨ãã¦ãã以ä¸ã³ãã³ãã
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/python /usr/bin/python sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/python-config /usr/bin/python-config sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw /usr/bin/pythonw
é©å½ã«å¨è¾ºãã¡ã¤ã«ãçªã£è¾¼ã
このへんããez_install.pyè½ã¨ãã¦ã¤ã³ã¹ãã¼ã«ã
sudo python ez_install.py sudo easy_install docutils sudo easy_install sphinx
ã¨ãããããããªæãã
PIL çªã£è¾¼ãï¼with Pythonï¼
æ®éã«ã³ã³ãã¤ã«ãã¦ãããã¨ãé¢åãã®ä¸ãªãã®ã§ãmac ports 使ã£ã¦ã¤ã³ã¹ãã¼ã«ã
$port search pil ----(ä¸ç¥)---- py26-pil @1.1.6 (python, graphics) Python Imaging Library
2.6 ããã®ãã
sudo port install py26-pil
python2.6 ãå
¥ã£ã¦ãªããã°åæã«ãããã
sudo port install python_select , sudo python_select python26 ãè¨å®ãã¦çµããã
æ¢ã« Python å
¥ã£ã¦ãå ´åã¯ãã·ã³ããªãã¯ãªã³ã¯ã追å ãã¾ããã
sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/ /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL
次㯠Django ããã
Django
ããã¯é常ã«ç°¡åã§ãããã
svn co http://code.djangoproject.com/svn/django/trunk/ cd trunk sudo python setup.py install
Python ã®å ´åã¯ã追å è¨è¿°ãå¿ è¦ã
sudo vi /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/utils/tzinfo.py
ã¸ãªã£ã¨ãã¡ã¤ã«éãã¦
try: DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii' # ãã®è¾ºè¿½å if DEFAULT_ENCODING == 'X-MAC-JAPANESE': DEFAULT_ENCODING = 'ascii'
*1:ã¹ã¯ãªããã®å é ã®ãã¹ãèªèéãããã¨æã