python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet

Posted by bower on November 19, 2009
linux/ubuntu, python

http://thenovello.com/alfondie/elkos/557 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

cherche homme pour mariage canada /var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet

go here

http://blossomjar.com/pacinity/2693 错误解决办法

click here Using MySQLdb 1.2.2 with python 2.6.1

http://tjez.gob.mx/perdakosis/622 When importing MySQLdb 1.2.2 into python 2.6.1 an error is reported:

http://fitbodz.com.au/?frimer=rencontre-r%C3%A9gionale-agroalimentaire&3a5=74 Python 2.6.1 (r261:67515, Dec 7 2008, 08:27:41)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLDB
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ImportError: No module named MySQLDB
>>> import MySQLdb
/usr/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet

conocer gente huaraz This is because the sets module is not built-in into the core distribution of python.

http://www.hedgeandstone.com.au/?miltos=rencontre-equestre-beaucaire-2015-programme&c3a=50 To get rid of this error and use the more efficient built-in set
type, do the following in the __init__.py file that was reported:

http://acepackinternational.com/?primre=site-de-rencontre-gratuit-pour-les-hommes&f81=d2 * comment line 34:

http://secfloripa.org.br/esminer/3841 When importing MySQLdb 1.2.2 into python 2.6.1 an error is reported:

Python 2.6.1 (r261:67515, Dec 7 2008, 08:27:41)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLDB
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ImportError: No module named MySQLDB
>>> import MySQLdb
/usr/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet

This is because the sets module is not built-in into the core distribution of python.

To get rid of this error and use the more efficient built-in set
type, do the following in the __init__.py file that was reported:

* comment line 34: from sets import ImmutableSet

* add after that line: ImmutableSet = frozenset

* comment line 41 in the original file: from sets import BaseSet

* add after that line: BaseSet = set

Like this the built-in types will be used anytime a BaseSet or an ImmutableSet is referenced.

Now everything works fine:

Python 2.6.1 (r261:67515, Dec 7 2008, 08:27:41)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
>>> MySQLdb.version_info
(1, 2, 2, ‘final’, 0)
>>>

都OK了,哈哈

enter 分享到:人人网开心网腾讯微博新浪微博豆瓣分享腾讯空间百度搜藏腾讯书签

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word