FAQs and solutions for installing Python + MySQL on Windows

Source: Internet
Author: User

From http:// I .19830102.com/archives/164

 

Python: 2.6
: Http://www.python.org/download/releases/2.6.1/
Download and install the MSI file

Mysqldb version: MySQL-python-1.2.2.win32-py2.6.exe
: Http://home.netimperia.com/files/misc/MySQL-python-1.2.2.win32-py2.6.exe
See: http://sourceforge.net/forum/forum.php? Thread_id = 2316047 & forum_id = 70460

FAQs:
1. importerror: DLL load failed: the specified module cannot be found.
----------------------------------
D: \ Program Files \ python2.6> Python
Python 2.6.1 (r261: 67517, DEC 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on Win32
Type "help", "copyright", "credits" or "License" for more information.
>>> Import mysqldb
Traceback (most recent call last ):
File "<stdin>", line 1, in <module>
File "D: \ Program Files \ python2.6 \ Lib \ Site-packages \ mysqldb \__ init _. py", line 19, in <module>

Import _ MySQL
Importerror: DLL load failed: the specified module cannot be found.
----------------------------------
Solution: Download The libmmd. dll (Attachment) and libguide40.dll (Attachment) DLL files and copy them to the Lib \ Site-packages directory of the python installation directory.
See: http://sourceforge.net/forum/message.php? Ms. g_id = 5613887

2. importerror: DLL load failed: the specified module cannot be found.
----------------------------------
D: \ Program Files \ python2.6> Python
Python 2.6 (R26: 66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on Win32
Type "help", "copyright", "credits" or "License" for more information.
>>> Import mysqldb
D: \ Program Files \ python2.6 \ Lib \ Site-packages \ mysqldb \__ init _. py: 34: deprecationwarning: The sets module is deprecated
From Sets Import immutableset
----------------------------------
Solution:
1) file "_ init _", replace:
 
From Sets Import immutableset
Class dbapiset (immutableset ):
 
With
 
Class dbapiset (frozenset)
 
2) file "converters. py", remove:
 
From Sets Import baseset, Set
 
3) file "converters. py", change "set" by "set" (important: only two places ):
 
Line 48: return set ([I for I in S. Split (',') If I])
Line 128: Set: set2str,
See: http://sourceforge.net/forum/message.php? Ms. g_id = 5808948

Attachment:
Libguide40.dll.zip (77.3 KB)
Libmmd.dll.zip (169 KB)
Libmysql.dll.zip (861 KB)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.