为 Django 设置 Cassandra - “AttributeError: “SystemManager”对象没有属性“describe_keyspace”
已按照 https://github.com/thobbs/twissandra 中的分步指南进行操作
我 被困在 python manage.pysync_cassandra 中,我收到消息:
['/home/z/twissandra', '/home/z/twiss/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/home/z/twiss/lib/python2.6/site-packages/pip-0.8.2-py2.6.egg', '/home/z/twiss/lib/python2.6', '/home/z/twiss/lib/python2.6/plat-linux2', '/home/z/twiss/lib/python2.6/lib-tk', '/home/z/twiss/lib/python2.6/lib-old', '/home/z/twiss/lib/python2.6/lib-dynload', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/home/z/twiss/lib/python2.6/site-packages', '/usr/local/lib/python2.6/dist-packages/pycassa-1.0.5-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/virtualenv-1.5.1-py2.6.egg', '/usr/local/lib/python2.6/site-packages', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0']
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/home/z/twissandra/tweets/management/commands/sync_cassandra.py", line 17, in handle_noargs
sys.describe_keyspace('Twissandra')
AttributeError: 'SystemManager' object has no attribute 'describe_keyspace'
我对此一无所知。该怎么办?
I've followed step-by-step guide in https://github.com/thobbs/twissandra
I'm stuck at python manage.py sync_cassandra
where I got message:
['/home/z/twissandra', '/home/z/twiss/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/home/z/twiss/lib/python2.6/site-packages/pip-0.8.2-py2.6.egg', '/home/z/twiss/lib/python2.6', '/home/z/twiss/lib/python2.6/plat-linux2', '/home/z/twiss/lib/python2.6/lib-tk', '/home/z/twiss/lib/python2.6/lib-old', '/home/z/twiss/lib/python2.6/lib-dynload', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/home/z/twiss/lib/python2.6/site-packages', '/usr/local/lib/python2.6/dist-packages/pycassa-1.0.5-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/virtualenv-1.5.1-py2.6.egg', '/usr/local/lib/python2.6/site-packages', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0']
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/z/twiss/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/home/z/twissandra/tweets/management/commands/sync_cassandra.py", line 17, in handle_noargs
sys.describe_keyspace('Twissandra')
AttributeError: 'SystemManager' object has no attribute 'describe_keyspace'
I have no idea about this. What to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是注意到我从未将sync_cassandra 分支(它解决了这个问题)合并到我的主分支中,因为我期望 ericflo 更快地接受拉取请求。
我刚刚合并了,所以拉出 master 分支并重试。顺便说一句,github 可能比 SO 更适合解决这个问题。
I just noticed that I never merged the sync_cassandra branch (which fixes this issue) into my master branch, because I was expecting ericflo to accept the pull request a little more quickly.
I just merged a moment ago, so pull the master branch and try again. By the way, github is probably a more appropriate place for this question than SO.
小提示,如果您在 Python 中遇到此错误并且您不知道原因,请检查循环导入。这就是我的问题所在。
例如,循环导入是模块 A 导入模块 B,模块 B 导入模块 A。在某些情况下,这不起作用。
Little tip, If you’re getting this error in Python and you have no idea why, check for circular imports. That’s what the problem was for me.
A circular import is for example module A imports module B and module B imports module A. There are certain scenarios where this doesn’t work.