我正在关注https://github.com/thobbs/twissandra
中的指南我仍然坚持:
cd twissandra
python manage.py sync_cassandra
python manage.py sync_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 16, in handle_noargs
sys.describe_keyspace('Twissandra')
AttributeError: 'SystemManager' object has no attribute 'describe_keyspace'
sudo python manage.py sync_cassandra
将生成
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/z/twissandra/tweets/management/commands/sync_cassandra.py", line 2, in <module>
import pycassa
ImportError: No module named pycassa
是的,那是错误..
但我有点困惑,sudo
或不sudo
... python manage.py sync_cassandra
或sudo python manage.py sync_cassandra
答案 0 :(得分:1)
解决。没有sudo
是正确的。它将使用虚拟环境中的python版本