新しいblogに移行しました

新ブログ "All Yout Bugs Are Belong To Ass" に移行しました!

2010-02-21

[Python]TurboGearsでtb-adminユーティリティがコケた - 奮闘篇

[Python]Ubuntu9.10でTurboGearsことはじめもチェックするヨロシ。

オイラのUbuntu9.10マシンでもこけました。

yt@nephos:~/turbogears$ tg-admin quickstart
Traceback (most recent call last):
File "/usr/bin/tg-admin", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2566, in
parse_requirements(__requires__), Environment()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: TurboJson>=1.1.4,<1.2


setuptoolsパッケージが足りない?


はあ、どうやらいくつかPythonパッケージが不足しているようで。
google先生教えてもらうところによると、どうやらFedora5でも同じような目にあった方が居たらしく、http://www.turbogears.org/にある ez_setup.py というスクリプトが必要らしい。
さらに調べてみたところでは、このスクリプトはsetuptoolsと呼ばれるパッケージのようだ。

ようし、www.turbogears.orgにアクセス!


アクセスしたら、上部メニューのInstallリンクをクリック。
How to install TurboGears 2って書かれたページに飛ばされるので、Prerequisites for all methodsのところにあるUnixの項を確認してみる。すると、

wget http://peak.telecommunity.com/dist/ez_setup.py | sudo python

だそうです。では実行。

yt@nephos:~/turbogears$ wget http://peak.telecommunity.com/dist/ez_setup.py | sudo python
--2010-02-21 13:56:43-- http://peak.telecommunity.com/dist/ez_setup.py
peak.telecommunity.com をDNSに問いあわせています... 209.190.5.234
peak.telecommunity.com|209.190.5.234|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 10285 (10K) [text/plain]
`ez_setup.py' に保存中

100%[======================================>] 10,285 25.5K/s 時間 0.4s

2010-02-21 13:56:43 (25.5 KB/s) - `ez_setup.py' へ保存完了 [10285/10285]

見てのとおり、このままではどう見てもDLするだけです。本当に有難うございました。
Ubuntuでは、

$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ sudo python ez_setup.py

としなくてはダメです。
では気を取り直して実行。

yt@nephos:~/turbogears$ sudo python ez_setup.py
Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to /usr/local/lib/python2.6/dist-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin

Installed /usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11

お、うまくsetuptoolsをインストールできたっぽいぞ。

改めて、tg-adminを実行


では、もう一度トライしてみる。

yt@nephos:~/turbogears$ tg-admin quickstartTraceback (most recent call last):
File "/usr/bin/tg-admin", line 5, in
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2607, in

File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 565, in resolve
error that occurred. Usually this will be a ``DistributionNotFound`` or
pkg_resources.DistributionNotFound: TurboJson>=1.1.4,<1.2

おろろ、ダメか。
あ、そういえば先ほどのフォーラムに、

http://www.turbogears.org/ からリンクをたどって、
ez_setup.py をダウンロードする。

# sudo python2.4 ez_setup.py -f http://www.turbogears.org/download/index.html --script-dir /usr/local/bin TurboGears

インストール済みの、TurboGears が conflict しているのでインストールできないという。-D オプションをつけろとあるのでやってみる。
# sudo python2.4 ez_setup.py -D -f http://www.turbogears.org/download/index.html --script-dir /usr/local/bin TurboGears

て書いてる。しまった、真ん中のコマンド以降は試していないじゃないか…
では試そう。

yt@nephos:~/turbogears$ sudo python2.4 ez_setup.py -f http://www.turbogears.org/download/index.html --script-dir /usr/local/bin TurboGears
sudo: python2.4: command not found

あ、インタプリタwww


yt@nephos:~/turbogears$ sudo python ez_setup.py -f http://www.turbogears.org/download/index.html --script-dir /usr/local/bin TurboGears
Searching for TurboGears
Best match: TurboGears 1.0.8
Adding TurboGears 1.0.8 to easy-install.pth file
Installing tg-admin script to /usr/local/bin

Using /usr/lib/pymodules/python2.6
Processing dependencies for TurboGears
Searching for TurboJson>=1.1.4,<1.2
Reading http://www.turbogears.org/download/index.html
Reading http://files.turbogears.org/eggs/
Reading http://pypi.python.org/simple/TurboJson/
Reading http://docs.turbogears.org/TurboJson
Reading http://www.turbogears.org/docs/plugins/template.html
Reading http://www.turbogears.org/download/
Best match: TurboJson 1.1.4
Downloading http://pypi.python.org/packages/source/T/TurboJson/TurboJson-1.1.4.tar.gz#md5=f05f01b84b7d8eaa5f161b0af123bfb7
Processing TurboJson-1.1.4.tar.gz
Running TurboJson-1.1.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SwYDni/TurboJson-1.1.4/egg-dist-tmp-01Z5s_
Adding TurboJson 1.1.4 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/TurboJson-1.1.4-py2.6.egg
Searching for TurboCheetah>=1.0
Reading http://pypi.python.org/simple/TurboCheetah/
Reading http://docs.turbogears.org/TurboCheetah
Best match: TurboCheetah 1.0
Downloading http://files.turbogears.org/eggs/TurboCheetah-1.0.tar.gz
Processing TurboCheetah-1.0.tar.gz
Running TurboCheetah-1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-tLG6Lc/TurboCheetah-1.0/egg-dist-tmp-qzNWkh
Adding TurboCheetah 1.0 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/TurboCheetah-1.0-py2.6.egg
Finished processing dependencies for TurboGears

おろ?いいんじゃないの??

再び改めて、tg-adminを実行するも…


ではでは、またトライしてみる。三度目の正直と言うし、きっと大丈夫。

yt@nephos:~/turbogears$ tg-admin quickstart
/usr/lib/pymodules/python2.6/cherrypy/lib/cptools.py:3: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
/usr/lib/pymodules/python2.6/cherrypy/filters/sessionfilter.py:33: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha
/usr/lib/pymodules/python2.6/dispatch/predicates.py:379: DeprecationWarning: object.__new__() takes no parameters
return ExprBase.__new__(klass,function,*argexprs)
/usr/lib/pymodules/python2.6/tw/core/view.py:223: DeprecationWarning: object.__new__() takes no parameters
obj = object.__new__(cls, *args, **kw)
Warning: using SQLAlchemy since your version of SQLObject does not meet the requirements: SQLObject>=0.10.1
Enter project name: ^CTraceback (most recent call last):
File "/usr/bin/tg-admin", line 8, in
load_entry_point('TurboGears==1.0.8', 'console_scripts', 'tg-admin')()
File "/usr/lib/pymodules/python2.6/turbogears/command/base.py", line 408, in main
command.run()
File "/usr/lib/pymodules/python2.6/turbogears/command/quickstart.py", line 188, in run
self.name = raw_input("Enter project name: ")
KeyboardInterrupt

おー。一応聞かれました。プロジェクト名何にするの?って。
でも、まだ文句を言われている模様。どうも

  • md5

  • sha

  • SQLObject


あたりに不足があるっぽい。どうすりゃいいのさ。

egg篇へ続く

0 件のコメント: