Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation of MySQLdb in python

Tags:

mysql-python

I have installed 3.3.0 python installer in windows. Then I want to install MySQLdb. I search the installation file for python 3.3.0, I got "MySQL-python-1.2.4b4.win32-py2.7" and installed it. But it shows that 'python version 2.7 required, which is not found in your registry'. I also got the solution in stackoverflow about this problem but my problem was not solved. What I have tried is explained below :

1. First I have exported python from registry HKEY_LOCAL_MACHINE-> Software.
2. I have saved the file in desktop.
3. I open it with notepad++.
4. Then I replaced all the LOCAL_MACHINE with CURRENT_USER and save it.
5. Finally  I executed the saved file in desktop.

But nothing happened, my problem is not solved and as it is as it before was. Is there any solution for it ?

like image 343
Bishnu Bhattarai Avatar asked Jan 19 '13 14:01

Bishnu Bhattarai


People also ask

Does MySQLdb work with python3?

MySQLdb module, a popular interface with MySQL is not compatible with Python 3.

What is Python MySQLdb package?

MySQLdb is an interface for connecting to a MySQL database server from Python. It implements the Python Database API v2. 0 and is built on top of the MySQL C API. Packages to Install. mysql-connector-python mysql-python.

How do I install SQL in Python?

For offline install, download the Python packagewhl file for CNTK and then copy the file to a local folder on the SQL Server computer. See Install CNTK from Wheel Files for a list of available . whl files for CNTK. Make sure that you get the Windows version of the package.

How do I install MySQLdb on Windows 10?

The simplest and recommended method is to download MySQL Installer for Windows from https://dev.mysql.com/downloads/installer/ and execute it. Select mysql-installer-web-community-8.0. 23. msi if you have good internet connection, otherwise choose mysql-installer-community-8.0.


1 Answers

Python libraries that uses compiled C extensions must be compiled against the exact version of Python. The MySQLdb package you downloaded is for python 2.7 and wouldn't work on python 3.3.

As far as I can tell, the MySQLdb does not support Python 3 yet and there's no plan to port it to Python 3

All hope is not lose, however. There are other MySQL wrappers, see MySQL-db lib for Python 3.x?

like image 153
Lie Ryan Avatar answered Oct 12 '22 22:10

Lie Ryan