MySql -python 1.2.1_p2 and visual c++ toolkit

S

simen.haugen

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/python-list/2004-December/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.
 
B

BartlebyScrivener

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,130
Members
46,689
Latest member
liammiller

Latest Threads

Top