3

I have a Fedora 11 box with MySQL server. Fedora 11 uses python 2.6 internally and python 2.6 is automatically installed on the box. I have created a python virtual-env for version 2.5.5, so that I can run turbogears 1.x application. I have MySQLdb rpm installed on the box (and it works fine with python 2.6).

When I import MySQLdb from within python version 2.6 it imports is successfully. When I import MySQLdb from within the python 2.5.5 virtual-env the import fails (because I have installed virtual-env with --no-site-packages). So, I have to install MySQLdb python as a local package (local to virtual-env).

'easy_install MySQL-python' within the virtual env fails. It downloads the MySQL-python-1.2.3.c1.tar.gz/download, but the 'python setup.py build' fails with error. The same problem occurs when building the MySQL outside of virtual-env.

Is the 'python setup.py build' for MySQL-python trying to link to a library (and am I missing some library)? Or is the downloaded code missing some header files (unlikely)?

Thanks.


S.Mark,

If I were to install MySQL header files, would they mess with the existing rpms?

[Sorry, for being redundant. In essence, MySQL is functional on the machine, MySQL-python is functional for python 2.6, but MySQL-python is not functional from virtualenv for python 2.5.5.]

Thank you for trying to help.

# rpm -qa | grep -i mysql
MySQL-python-1.2.3-0.4.c1.fc11.x86_64  
perl-DBD-MySQL-4.010-1.fc11.x86_64  
mysql-libs-5.1.42-7.fc11.x86_64  
mysql-5.1.42-7.fc11.x86_64  
php-mysql-5.2.12-1.fc11.x86_64  
mysql-server-5.1.42-7.fc11.x86_64
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
wizard
  • 41
  • 1
  • 5

4 Answers4

6
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
_mysql.c:39:26: error: mysqld_error.h: No such file or directory
_mysql.c:40:20: error: errmsg.h: No such file or directory

Please install MySQL header files, probably here

YOU
  • 120,166
  • 34
  • 186
  • 219
1

Works! Thanks for all your help.

I installed mysql-devel package (yum install mysql-devel) on the box.

Then did easy_install MySQL-python from within virtual-env (python 2.5.5), and the compilation/installation was successful (with some warnings).

Thanks.

wizard
  • 41
  • 1
  • 5
0

Just to mention for the others that might end up here too,

I solved this error in installing mysql-devel

$ yum install mysql-devel.x86_64 

Hope this helps

jlengrand
  • 12,152
  • 14
  • 57
  • 87
0

In case it does not work even after installing mysql-devel package, check the contents of "/usr/include/mysql".

If is empty then its possible that mysql-devel has installed the header files at some pther place, run following command to find

find /usr/include/ -maxdepth 1 -name mysql*

If found, create a symlink like following to fix the problem.

ln -s /usr/include/mysql51 /usr/include/mysql

Amit
  • 351
  • 1
  • 2
  • 8