MySQL_python install failed on Ubuntu 7.1

B

Bruza

I installed MySQL 5.0.45 on Ubuntu 7.1 and download MySQL_python from
Sourceforge (http://sourceforge.net/project/showfiles.php?
group_id=22307). Then I untar the package and executed "python
setup.py install". But I got compilation errors (see part of the
failed messages below).

Looks like the installation tried to compile the _mysql extension and
failed. Anybody knows a solution to this problem?

Thanks,

Bruza
==============================================
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.linux-i686-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-
prototypes -fPIC -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -
I/usr/include/mysql -I/usr/include/python2.5 -c _mysql.c -o build/
temp.linux-i686-2.5/_mysql.o -DBIG_JOINS=1
In file included from _mysql.c:29:
pymemcompat.h:10:20: error: Python.h: No such file or directory
_mysql.c:30:26: error: structmember.h: No such file or directory
In file included from /usr/include/mysql/mysql.h:43,
from _mysql.c:40:
/usr/include/sys/types.h:153: error: duplicate 'unsigned'
/usr/include/sys/types.h:153: error: two or more data types in
declaration specifiers
_mysql.c:64: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:65: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:66: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:67: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:68: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:69: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:70: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:71: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:72: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:73: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:74: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
_mysql.c:77: error: expected specifier-qualifier-list before
'PyObject_HEAD'
_mysql.c:87: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '_mysql_ConnectionObject_Type'
_mysql.c:90: error: expected specifier-qualifier-list before
'PyObject_HEAD'
_mysql.c:98: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '_mysql_ResultObject_Type'
_mysql.c:107: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
:
:
 
B

Bruno Desthuilliers

Bruza a écrit :
I installed MySQL 5.0.45 on Ubuntu 7.1 and download MySQL_python from
Sourceforge (http://sourceforge.net/project/showfiles.php?
group_id=22307). Then I untar the package and executed "python
setup.py install". But I got compilation errors (see part of the
failed messages below).

Looks like the installation tried to compile the _mysql extension and
failed. Anybody knows a solution to this problem?
(snip)

In file included from _mysql.c:29:
pymemcompat.h:10:20: error: Python.h: No such file or directory

Looks like gcc doesn't find the Python's headers. You probably need to
install the "python-dev" (or whatever it's named on Ubuntu) package,
that is the one with the required stuff to compile and link C libs
relying on CPython implementation.
 
B

Bruza

Bruza a écrit :



Looks like gcc doesn't find the Python's headers. You probably need toinstallthe "python-dev" (or whatever it's named onUbuntu) package,
that is the one with the required stuff to compile and link C libs
relying on CPython implementation.

Bruno,

I got it working! As you suggested, I did "sudo apt-get install python-
dev", then "sudo apt-get install mysqldb-python", and it's working
now. Thanks,

Bruza
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top