Setup Cassandra for Django - "python manage.py sync_cassandra" or "sudo python manage.py sync_cassandra"
I'm following guide in https://github.com/thobbs/twissandra
I'm still stuck at:
cd twissandra
python manage.py sync_cassandra
python manage.py sync_cassandra
will generate
['/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
will generate
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settin开发者_StackOverflow社区gs)
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
yes, that was errors..
But I'm a bit confuse, sudo
or not sudo
...
python manage.py sync_cassandra
or sudo python manage.py sync_cassandra
Solved. without sudo
is the right. It will use python version from virtual environment
精彩评论