TurboGears 1.0.2.2のセットアップをする
Python 2.5.1に正式に対応していますが、Python 2.4.4を推奨するメッセージが表示されます。
TurboGears Installer The recommended Python for TurboGears is Python 2.4.4. You can download it here: http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi Would you like to continue with a Python 2.5 install?yes/no[y] (y|n, default y)y Beginning setuptools/EasyInstall installation and TurboGears download Downloading http://cheeseshop.python.org/packages/2.5/s/setuptools/setuptools-0. 6c5-py2.5.egg Processing setuptools-0.6c5-py2.5.egg Copying setuptools-0.6c5-py2.5.egg to c:\python25\lib\site-packages Adding setuptools 0.6c5 to easy-install.pth file Installing easy_install-script.py script to C:\Python25\Scripts Installing easy_install.exe script to C:\Python25\Scripts Installing easy_install-2.5-script.py script to C:\Python25\Scripts Installing easy_install-2.5.exe script to C:\Python25\Scripts Installed c:\python25\lib\site-packages\setuptools-0.6c5-py2.5.egg Processing dependencies for setuptools==0.6c5 Searching for TurboGears[standard]>=1.0.2.2 Reading http://www.turbogears.org/download/ Reading http://cheeseshop.python.org/pypi/TurboGears/ Reading http://www.turbogears.org Reading http://www.turbogears.org/download/filelist.html Reading http://cheeseshop.python.org/pypi/TurboGears/1.0.2.2 Reading http://cheeseshop.python.org/pypi/TurboGears/"<a Best match: TurboGears 1.0.2.2 Downloading http://files.turbogears.org/eggs/TurboGears-1.0.2.2-py2.5.egg Processing TurboGears-1.0.2.2-py2.5.egg creating c:\python25\lib\site-packages\TurboGears-1.0.2.2-py2.5.egg Extracting TurboGears-1.0.2.2-py2.5.egg to c:\python25\lib\site-packages Adding TurboGears 1.0.2.2 to easy-install.pth file Installing tg-admin-script.py script to C:\Python25\Scripts Installing tg-admin.exe script to C:\Python25\Scripts Installed c:\python25\lib\site-packages\turbogears-1.0.2.2-py2.5.egg Reading http://files.turbogears.org/eggs/ Processing dependencies for TurboGears[standard]>=1.0.2.2 〜略〜
TurboGearsをインストールするとEasyInstallも自動的に導入されるので便利です。
あわせて必要なモジュールをどんどんインストールすると良いでしょう。
例として、Mechanizeをインストールしてみます。
# easy_install mechanize Searching for mechanize Reading http://cheeseshop.python.org/pypi/mechanize/ Reading http://wwwsearch.sourceforge.net/mechanize/ Reading http://cheeseshop.python.org/pypi/mechanize/0.1.6b Best match: mechanize 0.1.6b Downloading http://wwwsearch.sourceforge.net/mechanize/src/mechanize-0.1.6b.zip Processing mechanize-0.1.6b.zip Running mechanize-0.1.6b\setup.py -q bdist_egg --dist-dir c:\docume~1\superv~1\l ocals~1\temp\easy_install-xreuzy\mechanize-0.1.6b\egg-dist-tmp-9x7tze warning: no files found matching '0.1.0-changes.txt' no previously-included directories found matching 'docs-in-progress' Adding mechanize 0.1.6b to easy-install.pth file Installed c:\python25\lib\site-packages\mechanize-0.1.6b-py2.5.egg Processing dependencies for mechanize Searching for ClientForm==dev,>=0.2.6 〜略〜
インストール後はバージョンの確認をします。
class PythonModuleVersion: def python_version(self): try: import sys return 'Python', sys.version_info except ImportError: return 'Python ImportError' def turbogears_version(self): try: import turbogears return 'TurboGears', turbogears.__version__ except ImportError: return 'TurboGears ImportError' def mechanize_version(self): try: import mechanize return 'mechanize', mechanize.__version__ except ImportError: return 'mechanize ImportError'
実行結果は以下の通り。
('Python', (2, 5, 1, 'final', 0)) ('TurboGears', '1.0.2.2') ('mechanize', (0, 1, 6, 'b', None))
これに加えて、MySQLdbなどDBとのアダプタもインストールすれば、アプリケーション開発に取り掛かることができます。