Python では simplejson がデファクトっぽい感じだったので、simplejson をインストールしようと思ったら、以下のようなエラーメッセージが。。。
# wget http://pypi.python.org/packages/source/s/simplejson/simplejson-1.3.tar.gz#md5=fbe039b9b863572651a0f665acea34c9
# tar zxvf simplejson-1.3.tar.gz
# cd simplejson-1.3
# python setup.py install
---------------------------------------------------------------------------
This script requires setuptools version 0.6a11 to run (even to display
help). I will attempt to download it for you (from
http://cheeseshop.python.org/packages/2.5/s/setuptools/), but
you may need to enable firewall access for this script first.
I will start the download in 15 seconds.
(Note: if this machine does not have network access, please obtain the file
http://cheeseshop.python.org/packages/2.5/s/setuptools/setuptools-0.6a11-py2.5.egg
and place it in this directory before rerunning this script.)
---------------------------------------------------------------------------
Downloading http://cheeseshop.python.org/packages/2.5/s/setuptools/setuptools-0.6a11-py2.5.egg
Traceback (most recent call last):
File "setup.py", line 4, inez_setup.use_setuptools()
File "/private/var/root/tmp/simplejson-1.3/ez_setup/__init__.py", line 88, in use_setuptools
egg = download_setuptools(version, download_base, to_dir, download_delay)
File "/private/var/root/tmp/simplejson-1.3/ez_setup/__init__.py", line 142, in download_setuptools
src = urllib2.urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 124, in urlopen
return _opener.open(url, data)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 419, in error
result = self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 582, in http_error_302
return self.parent.open(new)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 425, in error
return self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
そもそも setuptools というのが必要みたい。(ごめんなさい。私は Python はよくわからないです。。。)
で、setuptools のサイト http://pypi.python.org/pypi/setuptools にアクセスして、Mac OS X の項を見つつ、次のように実施しました。
# wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg#md5=fe67c3e5a17b12c0e7c541b7ea43a8e6
# sh setuptools-0.6c9-py2.5.egg
なんと setuptools のインストールはとても簡単。
そして引き続き、simplejson のインストール
# python setup.py install
(中略)
Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/simplejson-1.3-py2.5.egg
Processing dependencies for simplejson==1.3
Finished processing dependencies for simplejson==1.3
すばらしい。あっさり入りましたぞ。
ってことで simplejson は setuptools があればあっさりインストールできますよ、というお話でした。
年末のテレビを見ながらダラダラと simplejson と setuptools を調べていた私でした。本年もどうぞよろしく。(なんのこっちゃ)
seealso: