:::: MENU ::::

simplenote.pyを入れてみる

simplenote の API を試して見たかったが公式を見たら、
google group への参加が必要みたいだったので、
気軽に試せる simplenote.py を入れてみることにした。

さくっと easy_install すればいいんだろうと思ったらこけた。

# easy_install simplenote
Searching for simplenote
Reading http://pypi.python.org/simple/simplenote/
Page at http://pypi.python.org/simple/simplenote/ links to .py file(s) without version info; an index scan is required.
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Reading https://github.com/mrtazz/simplenote.py
Download error: (-3, 'Temporary failure in name resolution') -- Some packages may not be found!
Best match: simplenote 0.1.3
Downloading http://pypi.python.org/packages/source/s/simplenote/simplenote-0.1.3.tar.gz#md5=29e622c1ffbf5383e4c17bedd4726df5
Processing simplenote-0.1.3.tar.gz
Running simplenote-0.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SOY_e4/simplenote-0.1.3/egg-dist-tmp-vCARWI
Traceback (most recent call last):
File "/usr/bin/easy_install", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
return f()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, ##kw
File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 476, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 655, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 930, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 919, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 61, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 105, in run
return func()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 64, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 8, in ?
File "/tmp/easy_install-SOY_e4/simplenote-0.1.3/simplenote/__init__.py", line 3, in ?
File "/tmp/easy_install-SOY_e4/simplenote-0.1.3/simplenote/simplenote.py", line 15, in ?
ImportError: No module named json

json モジュールがないので、easy_install で入れてみる。
が、そんなものはないと言われる。

# easy_install json
Searching for json
Reading http://pypi.python.org/simple/json/
Couldn't find index page for 'json' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for json
Best match: None
Traceback (most recent call last):
File "/usr/bin/easy_install", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
return f()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, ##kw
File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 434, in easy_install
self.local_index
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/package_index.py", line 475, in fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'

python2.6 以上じゃないと json モジュールは使えないようなので、
easy_install はやめてソースを落としてきて、simplenote/simplenote.py を編集することにした。

# cd /usr/local/src/mrtazz-simplenote.py-a2906ee/
# vi simplenote/simplenote.py
import json
↓
import simplejson

# easy_install simplejson

これでソースからインストールして完了。

# cd /usr/local/src/mrtazz-simplenote.py-a2906ee/
# python setup.py install