dotCloud CLIをLeopardに入れたときにエラーが発生。。。
結論から言うと、macportsを使用してのPythonでdotCloud CLIを動かすのはダメみたい。
それなりに時間を使ったのでメモを。
【環境】
Mac 10.5
MacPorts 2.0.4
DotCloud DocumentationのMacOSタブを選択して
dotCloud CLI (Command Line Interface)をターミナルを使用してインストールする。
$ sudo easy_install pip && sudo pip install dotcloud
Searching for pip
Best match: pip 1.1
Processing pip-1.1-py2.5.egg
pip 1.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip-2.5 script to /usr/local/bin
Using /Library/Python/2.5/site-packages/pip-1.1-py2.5.egg
Processing dependencies for pip
Finished processing dependencies for pip
Downloading/unpacking dotcloud
Running setup.py egg_info for package dotcloud
Traceback (most recent call last):
File “
File “/Users/takeda/build/dotcloud/setup.py”, line 47, in
install_requires = [‘dotcloud.cli == {0}’.format(VERSION)],
AttributeError: ‘str’ object has no attribute ‘format’
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “
File “/Users/takeda/build/dotcloud/setup.py”, line 47, in
install_requires = [‘dotcloud.cli == {0}’.format(VERSION)],
AttributeError: ‘str’ object has no attribute ‘format’
—————————————-
Command python setup.py egg_info failed with error code 1 in /Users/takeda/build/dotcloud
Storing complete log in /Users/hogehoge/Library/Logs/pip.log
pipはうまく入ったっぽいが、dotcloudのインストールでエラーが発生してるくさい。
strにはformatなんていう関数は無いよって。
調べたらpythonのバージョンが古いのが原因っぽい。
確認してみると
$ python –version
Python 2.5.1
やっぱり古かった。Pythonのバージョンは2.6以上じゃないとダメなようなので
MacPortsを使ってバージョンアップしてみる。
・Pythonのインストール
$ sudo port install python27
—> Fetching archive for expat
—> Attempting to fetch expat-2.1.0_0.darwin_9.i386.tgz from http://packages.macports.org/expat
省略
To make python 2.6 the default (i.e. the version you get when you run ‘python’), please run:
sudo port select –set python python27
・使用するバージョン選択するための準備
インストールしただけだとpython2.6は使えないので、使えるようにするために
python_selectをインストールする。
$ sudo port install python_select
—> Cleaning python_select
インストールできて内容な気がするけど念のためコマンドをたたいてみる。
・選択できるバージョンを確認
$ python_select -l
やっぱり出来てなかった。Command not foundって怒られる。
何やらpython_selectは使えないようだ。。
改めて、
$ sudo port select –list python
python25-apple (active)
python26
python27
・バージョンを選択
$ sudo python_select python27
・バージョンを確認
python -V
Python 2.5.2
なぜ。。。Pathが通ってないようなので.bash_profileに以下を追加
[shell]
export PATH=/opt/local/bin:/opt/local/shin:$PATH
[/shell]
$ source ./bash_profile
これで再度バージョン確認。
$ python -V
Python 2.7.2
これでやっとdotCloud CLIをインストールできると思ったら、今度はpipでダメだと。
pipも2.7に設定して、
$ sudo easy_install-2.7 pip && sudo pip-2.7 install dotcloud
としてインストールには成功してるみたいだけど、
$ dotcloud
-bash: dotcloud: command not found
だって。これ以上時間をかけたくないので他の方法でPythonを入れて試そう。