"DeprecationWarning: the sets module is deprecated"

689 views
Skip to first unread message

nbv4

unread,
May 1, 2009, 5:59:04 PM5/1/09
to Django users
Whenever I run the syncdb command, I get this error:

chris@chris-desktop:~/Websites/jobmap$ python manage.py syncdb
/var/lib/python-support/python2.6/MySQLdb/__init__.py:34:
DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet

I'm using Python 2.6 on Ununtu 9.04. I see this page:
http://code.djangoproject.com/ticket/8078 says the bug is fixed, but
for me it most definitely is not fixed. What the heck can I do to fix
this?

Alex Koshelev

unread,
May 1, 2009, 6:04:31 PM5/1/09
to django...@googlegroups.com
You see MySQLdb warning not Django.

May be you are using MySQLdb version that is not full compatible with Python 2.6

Malcolm Tredinnick

unread,
May 1, 2009, 6:08:34 PM5/1/09
to django...@googlegroups.com

Firstly, it's not a bug. A warning is being issued. It's not an error,
it's a warning. By definition, the code will continue to work perfectly.

Secondly, this isn't a Django warning. It's being issued by MySQLdb, the
external database wrapper for MySQL that we use. The ticket you refer to
(#8078) was a case of Django itself issuing that warning and one of our
goals for the 1.0 release was to not issue warnings on everything from
Python 2.3 through to the just-released 2.6. So we fixed things in our
own code (because, as you have just demonstrated, people do get a bit
jumpy when they see a warning).

MySQLdb is going through a few rewrites at the moment, but I believe
it's in a beta release at the moment. One problem there is that the
latest beta of MySQLdb doesn't run with Django itself, due to a lot of
internal changes in MySQLdb. Fixing that is something that I'm going to
be looking at very soon -- it's right near the top of my list of things
to attend to for Django 1.1.

So, for now and in conclusion, don't be worried by the warning. If you
really don't want to see it, have a look at the "-W" option that you can
pass to the "python" binary so that it is hidden. In the due course of
time, MySQLdb will be updated, Django will work with the latest version,
certainly as it hits final release and all that will happen before
Python removes the "sets" module.

Regards,
Malcolm


nbv4

unread,
May 1, 2009, 6:57:06 PM5/1/09
to Django users
The problem was it wasn't creating the tables like it should, all it
did was spit out that warning. I assumed that the warning was the
reason the tables weren't created. But I just now realized the reason
the tables weren't being created was because I forgot to add the app
in the settings.py file. Whoops :0

On May 1, 6:08 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Fri, 2009-05-01 at 14:59 -0700, nbv4 wrote:
> > Whenever I run the syncdb command, I get this error:
>
> > chris@chris-desktop:~/Websites/jobmap$ python manage.py syncdb
> > /var/lib/python-support/python2.6/MySQLdb/__init__.py:34:
> > DeprecationWarning: the sets module is deprecated
> >   from sets import ImmutableSet
>
> > I'm using Python 2.6 on Ununtu 9.04. I see this page:
> >http://code.djangoproject.com/ticket/8078says the bug is fixed, but

kammi-agk

unread,
May 27, 2009, 5:04:42 PM5/27/09
to Django users
I've got the same problem. It seems not just to be a warning. My
tables weren't created either.
Is there any solution for that problem in between?


On 2 Mai, 00:57, nbv4 <cp368...@ohio.edu> wrote:
> The problem was it wasn't creating the tables like it should, all it
> did was spit out that warning. I assumed that the warning was the
> reason the tables weren't created. But I just now realized the reason
> the tables weren't being created was because I forgot to add the app
> in the settings.py file. Whoops :0
>
> On May 1, 6:08 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
> wrote:
>
> > On Fri, 2009-05-01 at 14:59 -0700, nbv4 wrote:
> > > Whenever I run the syncdb command, I get this error:
>
> > > chris@chris-desktop:~/Websites/jobmap$ python manage.py syncdb
> > > /var/lib/python-support/python2.6/MySQLdb/__init__.py:34:
> > > DeprecationWarning: the sets module is deprecated
> > >   from sets import ImmutableSet
>
> > > I'm using Python 2.6 on Ununtu 9.04. I see this page:
> > >http://code.djangoproject.com/ticket/8078saysthe bug is fixed, but

Alex Gaynor

unread,
May 27, 2009, 5:41:30 PM5/27/09
to django...@googlegroups.com
DeprecationWarning is most definitely just a warning python throws when you import that module, it *does not affect* anything.  If your tables aren't being created the error is somewhere else.

Alex

--
"I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire
"The people's good is the highest law."--Cicero
Reply all
Reply to author
Forward
0 new messages