Prebuilt installation for windows platform is available on http://www.thescotties.com/mysql-python/test/.
Module has been built using: mysql-5.1.31-win3 and Microsoft Visual C++ 2008 Express Edition.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason is that there is no error handling/reporting after OpenKey() call.
D:\MySQL-python-1.2.3c1>setup.py install
Traceback (most recent call last):
File "D:\MySQL-python-1.2.3c1\setup.py", line 15, in <module>
metadata, options = get_config()
File "D:\MySQL-python-1.2.3c1\setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you think it should do? I guess it could say "Install MySQL first..." The exact registry key is in site.cfg. This won't fix easy_install, though, but you can use setup.py install (or bdist_windows or whatever it is)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it should state the reason for the error "Installation Error: MySQL installation required." and point to documentation for more info - "Please see README for details."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any sort of patching or tweaking you needed to do to build on WIndows? I imagine site.cfg slightly so that it looks for the right registry key due to the default being MySQL-5.0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually i changed two files. First inside _mysql.c I add additional include just before “#include <windows.h>”, so beginning of _mysql.c now looks like:
if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN32) || defined(MS_WIN32)
include <winsock2.h>
include <windows.h>
include <config-win.h>.
Additionally I changed setup_windows.py and there I replaced two lines that get library path from registry with one when that path is hardcoded:
Better way will be to get this value form site.cfg. So we could change setup_windows to check if mysql_root exists inside options. If exist that it should be used to build library path for mysql if doues not exist registry key should be used as currently implemented.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am using Python 2.6.1 , MySQL-4.0 and windows platform I want to install MySQLdb in my system, I tried http://www.codegood.com/archives/4 from this site but after installed successfull and after running my application its showing error as "No module named MySQLdb"
can any one suggest me proper setup to mysquldb, its urgent for me
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually i changed two files. First inside _mysql.c I add additional include just before “#include <windows.h>”, so beginning of _mysql.c now looks like:
if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN32) || defined(MS_WIN32)
include <winsock2.h>
include <windows.h>
include <config-win.h>.
Additionally I changed setup_windows.py and there I replaced two lines that get library path from registry with one when that path is hardcoded:
Better way will be to get this value form site.cfg. So we could change setup_windows to check if mysql_root exists inside options. If exist that it should be used to build library path for mysql if doues not exist registry key should be used as currently implemented.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Prebuilt installation for windows platform is available on http://www.thescotties.com/mysql-python/test/.
Module has been built using: mysql-5.1.31-win3 and Microsoft Visual C++ 2008 Express Edition.
Best regards
It fails to install from source if no MySQL is installed on target system without any descriptive error message.
>python -m easy_install MySQL-python
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python
Reading http://sourceforge.net/projects/mysql-python/
Best match: MySQL-python 1.2.3c1
Downloading http://osdn.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3c1.tar.gz
Processing MySQL-python-1.2.3c1.tar.gz
Running MySQL-python-1.2.3c1\setup.py -q bdist_egg --dist-dir c:\docume~1\user\locals~1\temp\easy_install-nw-cu1\MySQL-python-1.2.3c1\egg-dist-tmp-b6z1px
error:
The reason is that there is no error handling/reporting after OpenKey() call.
D:\MySQL-python-1.2.3c1>setup.py install
Traceback (most recent call last):
File "D:\MySQL-python-1.2.3c1\setup.py", line 15, in <module>
metadata, options = get_config()
File "D:\MySQL-python-1.2.3c1\setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2]
What do you think it should do? I guess it could say "Install MySQL first..." The exact registry key is in site.cfg. This won't fix easy_install, though, but you can use setup.py install (or bdist_windows or whatever it is)
I think it should state the reason for the error "Installation Error: MySQL installation required." and point to documentation for more info - "Please see README for details."
Any sort of patching or tweaking you needed to do to build on WIndows? I imagine site.cfg slightly so that it looks for the right registry key due to the default being MySQL-5.0.
Actually i changed two files. First inside _mysql.c I add additional include just before “#include <windows.h>”, so beginning of _mysql.c now looks like:
if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN32) || defined(MS_WIN32)
include <winsock2.h>
include <windows.h>
include <config-win.h>.
Additionally I changed setup_windows.py and there I replaced two lines that get library path from registry with one when that path is hardcoded:
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
mysql_root = "C:\Projects\Misc\mysql-python\mysql-5.1.31-win32"
Better way will be to get this value form site.cfg. So we could change setup_windows to check if mysql_root exists inside options. If exist that it should be used to build library path for mysql if doues not exist registry key should be used as currently implemented.
Best regards
Hi
I am using Python 2.6.1 , MySQL-4.0 and windows platform I want to install MySQLdb in my system, I tried http://www.codegood.com/archives/4 from this site but after installed successfull and after running my application its showing error as "No module named MySQLdb"
can any one suggest me proper setup to mysquldb, its urgent for me
Thanks in advance
Actually i changed two files. First inside _mysql.c I add additional include just before “#include <windows.h>”, so beginning of _mysql.c now looks like:
if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN32) || defined(MS_WIN32)
include <winsock2.h>
include <windows.h>
include <config-win.h>.
Additionally I changed setup_windows.py and there I replaced two lines that get library path from registry with one when that path is hardcoded:
Better way will be to get this value form site.cfg. So we could change setup_windows to check if mysql_root exists inside options. If exist that it should be used to build library path for mysql if doues not exist registry key should be used as currently implemented.
Best regards
There is a thing that puzzles me in last years a lot.
Why people do such complicated preprocessor tweaking
if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN32) || defined(MS_WIN32)
when just ifdef(_WIN32) would always suffice?
Thanks for the update bobrock! Great to have you as a lifesaver in the win32 dev world :)
Why would I need MySQL installed if I am accessing a remotely hosted MySQL
server???
Also is there any update on a windows MSI for Py2.6 yet ??? easy_install
failes and I have having the same problem as kalyanbe.