Instalando o Graphite no Ubuntu 12.10

0

Estou tentando instalar e executar o Graphite no Ubuntu 12.10. Para fazer isso eu segui este manual .

Infelizmente no passo:

Next, we will configure the Graphite database. Go to the Graphite webapp directory and run the database script:

cd /opt/graphite/webapp/graphite/

sudo python manage.py syncdb

Eu recebo o seguinte erro:

Could not import graphite.local_settings, using defaults!
Could not import graphite.local_settings, using defaults!
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in execute
    self.validate()
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
    self._populate()
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 67, in _populate
    self.load_app(app_name)
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
    models = import_module('.models', app_name)
  File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/events/models.py", line 6, in <module>
    from tagging.managers import ModelTaggedItemManager
  File "/usr/local/lib/python2.7/dist-packages/django_tagging-0.3.2-py2.7.egg/tagging/managers.py", line 8, in <module>
    from .models import Tag, TaggedItem
  File "/usr/local/lib/python2.7/dist-packages/django_tagging-0.3.2-py2.7.egg/tagging/models.py", line 7, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name python_2_unicode_compatible

Qual pode ser a causa do problema?

Como posso corrigir isso?

    
por IvanMushketyk 02.04.2014 / 17:17

1 resposta

1

Hoje, enfrentei exatamente o mesmo problema usando o mesmo manual que você. Eu acho que o problema está relacionado ao fato de que algumas dependências python estão instaladas para 2.7 e algumas estão instaladas para 3.2. Então eu decidi instalar o 2.7 e pular todos os pacotes para 3.2.

$ sudo apt-get install apache2 apache2-mpm-worker \
    apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 \
    libaprutil1-dbd-sqlite3 build-essential \
    python-dev \
    libapache2-mod-wsgi libaprutil1-ldap memcached \
    python-cairo-dev python-ldap python-memcache \
    python-pysqlite2 sqlite3 erlang-os-mon erlang-snmp rabbitmq-server \
    bzr expect libapache2-mod-python python-setuptools

$ sudo easy_install django django-tagging zope.interface twisted txamqp

Quando eu uso esses dois comandos em vez dos comandos no manual, não recebo mais o erro que você mencionou:

ImportError: cannot import name python_2_unicode_compatible
    
por Nic 11.04.2014 / 12:39