469,322 Members | 1,626 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

MySql -python 1.2.1_p2 and visual c++ toolkit

Hi.

I'm trying to use Python 2.4 with MySql 5.0, but I'm having
installation problems.

I've tried to follow the following articles to install mysql-python
with the free visual c++ toolkit
http://mail.python.org/pipermail/pyt...er/255184.html
http://www.vrplumber.com/programming/mstoolkit/

but when I'm trying to install mysql-python, I get the following errors
:

C:\Python24\Lib\site-packages\MySQL-python-1.2.1_p2>python setup.py
install
running install
running build
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.4\MySQLdb
running build_ext
building '_mysql' extension
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe /c
/nologo /Ox /MD
/W3 /GX /DNDEBUG -Ic:\python24\include -Ic:\python24\PC /Tc_mysql.c
/Fobuild\te
mp.win32-2.4\Release\_mysql.obj -Dversion_info="(1,2,1,'final',2)"
-D__version__
="1.2.1_p2"
_mysql.c
c:\Python24\include\structmember.h(73) : warning C4005:
'WRITE_RESTRICTED' : mac
ro redefinition
C:\Program Files\Microsoft Platform SDK for Windows XP
SP2\Include\WinNT
..h(4727) : see previous definition of 'WRITE_RESTRICTED'
_mysql.c(1350) : warning C4018: '<' : signed/unsigned mismatch
_mysql.c(2804) : error C2015: too many characters in constant
_mysql.c(2804) : warning C4047: 'function' : 'const char *' differs in
levels of
indirection from 'int'
_mysql.c(2808) : error C2059: syntax error : 'bad suffix on number'
_mysql.c(2808) : error C2440: 'function' : cannot convert from 'double'
to 'cons
t char *'
_mysql.c(2808) : warning C4024: 'PyString_FromString' : different types
for form
al and actual parameter 1
_mysql.c(2808) : error C2143: syntax error : missing ')' before
'constant'
error: command '"C:\Program Files\Microsoft Visual C++ Toolkit
2003\bin\cl.exe"'
failed with exit status 2

It failes on the second line here :
if (PyDict_SetItemString(dict, "version_info",
PyRun_String(version_info, Py_eval_input,
dict, dict)))

As I'm new to python, I cant really figure out what the error is. The
C2015 error states that I'm trying to pass a char* where a char is
needed.
version_info is, as far as I can see, defined in metadata.cfg as
version_info: (1,2,1,'final',2)

Still this doeasnt tell me much..

I hope that someone can help me with this problem.

Apr 17 '06 #1
2 1655
I'm pretty new myself. But if you don't get anywhere using
mysql-python, I can recommend

mxODBC. I have connected to both MS Access DB and MySQL DB. You get it
from:

http://www.egenix.com/files/python/mxODBC.html

But read the instructions carefully as I think there are two things to
install.

If you search on python-msql and compare to mxODBC in this forum it
seems people have an easier time with mxODBC.

rpd

Apr 17 '06 #2
I tried mxODBC now, and it worked out of the box. Thanks for the tip!

Apr 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by mikey | last post: by
reply views Thread by Yun Guan | last post: by
reply views Thread by Mike Chirico | last post: by
2 posts views Thread by Saqib Ali | last post: by
2 posts views Thread by trihanhcie | last post: by
Atli
6 posts views Thread by Atli | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.