MySQLdb within python2.5 virtualenv

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

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

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

Is "python setup.py build" for MySQL-python trying to link to a library (and I missed some kind of library)? Or does the downloaded code skip some header files (unlikely)?

Thank.


S.Mark,

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

[Sorry for the redundancy. MySQL essentially runs on a machine, MySQL-python is functional for python 2.6, but MySQL-python does not work with virtualenv for python 2.5.5.]

Thanks for the 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
+3
4
_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

, MySQL,

+6

! .

mysql-devel (yum install mysql-devel) .

easy_install MySQL-python virtual-env (python 2.5.5), / ( ).

.

+1

, ,

mysql-devel

$ yum install mysql-devel.x86_64 

,

0

mysql-devel, "/usr/include/mysql".

, , mysql-devel , ,

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

, , , .

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

0
source

Source: https://habr.com/ru/post/1733725/


All Articles