为 Django 设置 Cassandra - “AttributeError: “SystemManager”对象没有属性“describe_keyspace”

发布于 2024-10-17 14:35:04 字数 2246 浏览 5 评论 0原文

已按照 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

强辩 2024-10-24 14:35:05

我只是注意到我从未将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.

默嘫て 2024-10-24 14:35:05

小提示,如果您在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文