2014年12月10日水曜日

MacOS X LionにOpenStack Swiftのclientを入れる

だんだんLionのままにしてるの恥ずかしくなってきたけど…



// pipがなかったのでいれる
$ sudo easy_install pip

// swiftのclient入れる
$ sudo pip install python-swiftclient

// 怒られる
$ swift
Traceback (most recent call last):
  File "/usr/local/bin/swift", line 7, in 
    from swiftclient.shell import main
  File "/Library/Python/2.7/site-packages/swiftclient/__init__.py", line 20, in 
    from .client import *
  File "/Library/Python/2.7/site-packages/swiftclient/client.py", line 34, in 
    from swiftclient import version as swiftclient_version
  File "/Library/Python/2.7/site-packages/swiftclient/version.py", line 27, in 
    import pbr.version
ImportError: No module named pbr.version

// 足りなそうなもの入れる
$ sudo pip install pbr

// 違う理由で怒られる
$ swift --version
Traceback (most recent call last):
  File "/usr/local/bin/swift", line 7, in 
    from swiftclient.shell import main
  File "/Library/Python/2.7/site-packages/swiftclient/__init__.py", line 20, in 
    from .client import *
  File "/Library/Python/2.7/site-packages/swiftclient/client.py", line 34, in 
    from swiftclient import version as swiftclient_version
  File "/Library/Python/2.7/site-packages/swiftclient/version.py", line 28, in 
    version_string = str(pbr.version.VersionInfo('python-swiftclient'))
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 39, in __str__
    return self.version_string()
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 78, in version_string
    for part in self.release_string().split('.'):
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 70, in release_string
    self.release = self._get_version_from_pkg_resources()
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources
    return packaging.get_version(self.package)
  File "/Library/Python/2.7/site-packages/pbr/packaging.py", line 870, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

// このwaringあやしい
$ pip list
(略)
Warning: cannot find svn location for setuptools==0.6c12dev-r85381

// upgradeしてみる
$ sudo pip install --upgrade setuptools

// ちゃんと動いた
$ swift --version
swift 2.3.1