WebFaction
Community site: login faq

I am having problem with 1 error, I installed all apps on Django 1.6.2 and Django 1.5.5 and having the same problem.

My settings are:

Django 1.5.5

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'polib',
    'easymode',
    'localeurl',
    'rosetta',
    'efc',
)

Django 1.6.2

INSTALLED_APPS += (
    "polib",
    "easymode",
    "localeurl",
    "rosetta",
    "efc",
)

And here is the error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/base.py", line 284, in execute
    self.validate()
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/efc/webapps/efc/lib/python2.7/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/efc/webapps/efc/lib/python2.7/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/home/efc/webapps/efc/lib/python2.7/django/db/models/loading.py", line 78, in _populate
    self.load_app(app_name)
  File "/home/efc/webapps/efc/lib/python2.7/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/home/efc/webapps/efc/lib/python2.7/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/efc/webapps/efc/myproject/efc/models.py", line 4, in <module>
    from easymode.i18n.decorators import I18n
  File "/home/efc/lib/python2.7/easymode/i18n/__init__.py", line 22, in <module>
    import easymode.i18n.gettext
  File "/home/efc/lib/python2.7/easymode/i18n/gettext.py", line 24, in <module>
    from easymode.utils import polibext
  File "/home/efc/lib/python2.7/easymode/utils/polibext.py", line 11, in <module>
    from rosetta import polib
ImportError: cannot import name polib

The last line in the 'polibext.py' line 11 is:

if 'rosetta' in settings.INSTALLED_APPS:
    from rosetta import polib
else:
    try:
        import polib
    except ImportError:
        raise ImproperlyConfigured(
            """
            Please install either django-rosetta: 
            http://code.google.com/p/django-rosetta/
            or polib:
            http://bitbucket.org/izi/polib/src/
            otherwise easymode.utils.polibext won't work"""
        )

I installed both. Still having the error. Can you please help?

Thanks

asked 22 Mar '14, 07:31

rentgeeen
4721219
accept rate: 0%

edited 22 Mar '14, 07:38


An ImportError when trying to import a library that is installed usually means that your application doesn't have the correct python path set.

This can be set in your WSGI script or httpd.conf file, and more information is available in our documentation here. Hope that helps!

permanent link

answered 22 Mar '14, 09:03

ryans ♦♦
5.0k93160
accept rate: 43%

I added the path to http.conf and still having the same error: https://www.dropbox.com/s/3diyo8lpw5zm8t0/Screenshot%202014-03-22%2011.30.45.png https://www.dropbox.com/s/dhy95xlevcbqizi/Screenshot%202014-03-22%2011.31.18.png dont understand why I still have the error. thanks

(22 Mar '14, 15:31) rentgeeen

This is my path:

Python Path:
['/home/efc/webapps/efc', '/home/efc/webapps/efc/myproject', '/home/efc/webapps/efc/lib/python2.7', '/home/efc/lib/python2.7/django_localeurl-2.0.1-py2.7.egg', '/home/efc/lib/python2.7/requests-2.2.1-py2.7.egg', '/home/efc/lib/python2.7/Django-1.6.2-py2.7.egg', '/home/efc/lib/python2.7/six-1.6.1-py2.7.egg', '/home/efc/lib/python2.7/django_rosetta-0.7.4-py2.7.egg', '/home/efc/lib/python2.7/polib-1.0.4-py2.7.egg', '/home/efc/lib/python2.7/django_localeurl-2.0.1-py2.7.egg', '/home/efc/lib/python2.7/polib-1.0.4-py2.7.egg', '/home/efc/lib/python2.7', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages/PIL']

Doesnt make any sence it is in there.

(22 Mar '14, 17:13) rentgeeen

Problem was django-rosetta 0.7.4, I installed 0.7.0 and it works now :) Weird bug. thanks

(22 Mar '14, 19:37) rentgeeen

That is quite weird. It seems like django-rosetta 0.7.4 didn't have a "polib.py" or "polib/__init__.py" file. Or, if it did, it was broken.

Glad you've fixed it!

(23 Mar '14, 01:05) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×905
×52
×27
×15
×4

question asked: 22 Mar '14, 07:31

question was seen: 13,430 times

last updated: 23 Mar '14, 01:05

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM