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
2
  • 1
    Are we supposed to guess what error? Commented Feb 21, 2010 at 3:07
  • Without the error its impossible to guess what might have gone wrong Commented Feb 22, 2010 at 4:57

4 Answers 4

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

Sign up to request clarification or add additional context in comments.

1 Comment

Just to mention for the others that might end up here too.
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.

1 Comment

glad it worked. you should give those that helped you some +1 karma, it's the stackoverflow way. :)
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

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.