0

この指示でSwiftをインストールしようとしました

ソースからSwiftをインストールしようとすると(gitクローンの後)、pythonインストーラーからエラーが発生します:

Traceback (most recent call last):
File "setup.py", line 22, in <module>
  pbr=True)
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
  dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
  self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
  cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/develop.py", line 27, in run
  self.install_for_development()
File "/usr/lib/python2.7/dist-packages/setuptools/command/develop.py", line 105, in install_for_development
  self.process_distribution(None, self.dist, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
  [requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 576, in resolve
  dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 821, in best_match
  return self.obtain(req, installer) # try and download/install
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 833, in obtain
  return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
  return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
  dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
  return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1094,   in run_setup
  run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 30, in run_setup
  lambda: execfile(
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 72, in run
  return func()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 32, in <lambda>
  {'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 60, in <module>

File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
  dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
  self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 970, in run_command
  cmd_obj = self.get_command_obj(command)
File "/usr/lib/python2.7/distutils/dist.py", line 846, in get_command_obj
  cmd_obj = self.command_obj[command] = klass(self)
File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 70, in __init__
  _Command.__init__(self,dist)
File "/usr/lib/python2.7/distutils/cmd.py", line 59, in __init__
  raise TypeError, "dist must be a Distribution instance"
TypeError: dist must be a Distribution instance

まず、Swift を CentOS にインストールしてから Ubuntu 12.04 にインストールしようとしましたが、同じエラーが発生しました。あなたはなにか考えはありますか?

4

1 に答える 1

1

問題の回避策は次のとおりです。

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.8.tar.gz
tar zxvf setuptools-0.9.8.tar.gz
cd setuptools-0.9.8/
sudo python setup.py install
cd
sudo easy_install pip
sudo aptitude install libffi-dev
git clone git@github.com:openstack/swift.git
cd swift/
sudo python setup.py install`

この問題は次の場所で説明されています: https://bitbucket.org/pypa/setuptools/issue/73/typeerror-dist-must-be-a-distribution

この回避策を使用しましたが、Ubuntu 12.04 サーバーの仮想インスタンスでうまくいきました。

于 2013-09-07T22:25:22.757 に答える