Discussion:
cannot import name ugettext_lazy
Wayne Dyck
17 years ago
Permalink
A couple of applications I have tried to install fail trying to import
ugettext_lazy. Specifically the import line is:

django.utils.translation import ugettext_lazy as _

I have seen a number of posts that suggest getting the latest source
from SVN. I have Django version 96.2 and I have downloaded the latest
1.0 alpha (or something close to that) from SVN. The ugettext_lazy is
missing from both.

Any help or suggestions on what I have missed would be appreciated.

Thanks.

Wayne

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Karen Tracey
17 years ago
Permalink
Post by Wayne Dyck
A couple of applications I have tried to install fail trying to import
django.utils.translation import ugettext_lazy as _
I have seen a number of posts that suggest getting the latest source
from SVN. I have Django version 96.2 and I have downloaded the latest
1.0 alpha (or something close to that) from SVN. The ugettext_lazy is
missing from both.
Any help or suggestions on what I have missed would be appreciated.
Make sure you have an SVN checkout at revision 8680 or higher. This:

http://code.djangoproject.com/ticket/8654

looks like it could be responsible for what you are reporting, and the fix
was only checked in about five hours ago.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Malcolm Tredinnick
17 years ago
Permalink
On Thu, 2008-08-28 at 21:18 -0400, Karen Tracey wrote:
[...]
Post by Karen Tracey
http://code.djangoproject.com/ticket/8654
looks like it could be responsible for what you are reporting, and the
fix was only checked in about five hours ago.
No, that's unrelated. The __all__ variable is only relevant for the
"from foo import *" style of imports. When importing by name, it looks
directly in the module.

I think the original poster's tarball of Django is broken. At least the
1.0-alpha version is. The 0.96 releases never had ugettext_lazy().

The function has been in trunk since July 4, 2007 (when the unicode
branch was merged in [5609]). If ugettext_lazy() was made unavailable,
it would take about 15 seconds for the bugs to be reported. It's used
all over the place, even inside Django.

Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Wayne Dyck
17 years ago
Permalink
Post by Malcolm Tredinnick
I think the original poster's tarball of Django is broken. At least the
1.0-alpha version is. The 0.96 releases never had ugettext_lazy().
So I should be seeing it at this location django.utils.translation in
the latest SVN beta? I browsed the code today on the website and
didn't see it in there.

Is this something simple that I am missing?

Wayne

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Malcolm Tredinnick
17 years ago
Permalink
Post by Wayne Dyck
Post by Malcolm Tredinnick
I think the original poster's tarball of Django is broken. At least the
1.0-alpha version is. The 0.96 releases never had ugettext_lazy().
So I should be seeing it at this location django.utils.translation in
the latest SVN beta? I browsed the code today on the website and
didn't see it in there.
Well, it's int django/utils/translation/__init__.py. Specifically:

http://code.djangoproject.com/browser/django/trunk/django/utils/translation/__init__.py#L70

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Wayne Dyck
17 years ago
Permalink
http://code.djangoproject.com/browser/django/trunk/django/utils/trans...
It looks like it was just checked in a little while ago. I will
download the latest from SVN and try that.

Thanks. I appreciate it.

Wayne

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Malcolm Tredinnick
17 years ago
Permalink
Post by Wayne Dyck
http://code.djangoproject.com/browser/django/trunk/django/utils/trans...
It looks like it was just checked in a little while ago. I will
download the latest from SVN and try that.
No, it wasn't. I'm really not making this up: ugettext_lazy() has been
in trunk since July 4 last year!

It was added to __all__ a few hours ago, but that is irrelevant to the
question you asked, as I indicated in my reply to Karen. If you're
actually doing "from django.utils.translation import *" and then trying
to use ugettext_lazy, that would be a different story, but that wasn't
what you said you were doing.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Wayne Dyck
17 years ago
Permalink
Post by Malcolm Tredinnick
No, it wasn't. I'm really not making this up: ugettext_lazy() has been
in trunk since July 4 last year!
Bizarre. Okay. I will take your word for it. I am fairly new to Django
so I am not excusing the fact that it might simply be ignorance on my
part how everything works and the location of the functions.

I will download the latest from SVN, try again, and let you know how I
make out.

Thanks again for your information.

Wayne

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...