Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing mysql for python 2.7

D:\PythonPack\MySQL-python-1.2.3>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    metadata, options = get_config()
  File "D:\PythonPack\MySQL-python-1.2.3\setup_windows.py", line 7, in get_confi
g
    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_ke
y'])
WindowsError: [Error 2] The system cannot find the file specified

I am trying to install mysqldb for python in windows7 and run into that error message

Do you have an idea how I can make it work ? I already have pythonsetuptool installed

like image 713
Joe Mo Avatar asked Aug 27 '26 17:08

Joe Mo


1 Answers

Actually there are many ways and i tried them for few hours and realize its time waste process bcoz MYSQLdb is vary from version to version i.e 2.6,2.7 and 3.2 but all those are confuse and time waste processes, Instead best way is to get precompiled executables from : http://www.lfd.uci.edu/~gohlke/pythonlibs . here choose version wise links like python 2.7 and 32bit so that you won't get any errors and now run the downloaded file, finally set path in environment variables. Now open python IDLE editor or from command prompt c:>python import MySQLdb

if u don't get any errors then it's working fine...enjoy with u r work

like image 196
Manoj Avatar answered Aug 29 '26 07:08

Manoj