« あけましておめでとうございます | Main | MacBook Wheel? »

31 December 2008

simplejson と setuptools と私

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, in

    ez_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:

TrackBack

TrackBack URL for this entry:
http://bb.lekumo.jp/t/trackback/517129/31022897

Listed below are links to weblogs that reference simplejson と setuptools と私:

Comments

Hy Mike,i try to install and use the lib but i have plerboms with that, when i run easy_install twitter i've got:Processing twittererror: Couldn't find a setup script in twittervia python setup.py install looks very good, i have no problem, but when i try twitter -h this is the output:Traceback (most recent call last):File /usr/bin/twitter , line 8, inload_entry_point( twitter==0.2 , console_scripts', twitter')()File /usr/lib/python2.5/site-packages/pkg_resources.py , line 277, in load_entry_pointreturn get_distribution(dist).load_entry_point(group, name)File /usr/lib/python2.5/site-packages/pkg_resources.py , line 2179, in load_entry_pointreturn ep.load()File /usr/lib/python2.5/site-packages/pkg_resources.py , line 1912, in loadentry = __import__(self.module_name, globals(),globals(), ['__name__'])ImportError: No module named cmdlinecan you drop me a line?cheers!

I'm truly enjoying the design and layout of your website. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Fantastic work!

What's up, just wanted to tell you, I enjoyed this article. It was inspiring. Keep on posting!

I'm not sure exactly why but this site is loading extremely slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later and see if the problem still exists.

I constantly spent my half an hour to read this web site's posts everyday along with a cup of coffee.

Hi to all, since I am really keen of reading this webpage's post to be updated on a regular basis. It carries fastidious data.

You can certainly see your skills within the article you write. The world hopes for more passionate writers like you who are not afraid to mention how they believe. At all times go after your heart.

Post a comment

Access Ranking

Powered by Six Apart
Sponsored links