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://www.qiongbupa.com/martisd/1913 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

http://katietraxler.com/?vuiowew=sites-de-rencontres-avec-chat&33f=f8 /var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet

http://josiart.at/rete/3549

description 错误解决办法

rs232 hookup Using MySQLdb 1.2.2 with python 2.6.1

كيفية استثمار المال لكسب المال When importing MySQLdb 1.2.2 into python 2.6.1 an error is reported:

http://www.cablackhealthnetwork.org/biopo/9271 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

http://havanatranquility.com/daeso/3042 This is because the sets module is not built-in into the core distribution of python.

http://huntersneeds.net/rigaro/6707 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:

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了,哈哈

http://www.juancampodonico.com/milyoki/925 分享到:人人网开心网腾讯微博新浪微博豆瓣分享腾讯空间百度搜藏腾讯书签

分享给你的朋友->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