Ask Your Question
0

Horizon: How to fix "cannot import force_unicode" in apaches error.log

asked 2013-06-18 04:28:05 -0600

anonymous user

Anonymous

updated 2013-06-18 05:26:18 -0600

jpichon gravatar image

When trying out horizon (in my case from the grizzly release) I continuously got python errors stating "cannot import force_unicode" in the code line "from django.utils.translation import force_unicode, get_text_lazy..."

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-02-11 10:23:04 -0600

dimitern gravatar image

updated 2014-02-13 14:25:09 -0600

koolhead17 gravatar image

In case you were having this issue when using Juju to deploy openstack horizon, it was due to this bug: https://bugs.launchpad.net/cloud-archive/+bug/1240667

A fix for it will be available in the next development/stable release of juju-core (1.17.3 or 1.18).

edit flag offensive delete link more
1

answered 2013-06-18 04:28:52 -0600

wendorff gravatar image

updated 2013-12-23 04:38:04 -0600

If that's the case, it's a hint that the wrong version of Django is used. Horizon in the Grizzly release depends on Django 1.4.x and is not compatible with Django 1.5, which leads to this error.

To solve that uninstall the wrong django version. This may be

  • uninstalling python-django with your OS package manager (check before if it's the wrong version)

  • uninstall django with pip.

For me it was the following:

  • django 1.4.5 has been installed by the operating system correctly (to check: dpkg-query -l *django*)

  • django 1.5.1 has been installed internally by python in the wrong version, to check use: pip show django

to uninstall the pip package:

pip uninstall django

to uninstall the dpkg package:

apt-get remove python-django

As soon as Django 1.5.1 is gone (and Django 1.4.x is still there) restart apache (service apache2 restart) and try again, the error should be gone.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Get to know Ask OpenStack

Resources for moderators

Stats

Asked: 2013-06-18 04:28:05 -0600

Seen: 1,075 times

Last updated: Feb 13 '14