Ask Your Question

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

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

anonymous user


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

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

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

wendorff gravatar image

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

Jobin gravatar image

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

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

dimitern gravatar image

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

koolhead17 gravatar image

In case you were having this issue when using Juju to deploy openstack horizon, it was due to this bug:

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

Get to know Ask OpenStack

Resources for moderators

Question Tools


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

Seen: 1,853 times

Last updated: Feb 13 '14