Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python easy_install: specify directory housing required files

I'm trying to use easy_install to install MySQL-python. It fails almost immediately:

_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

It can't find the headers. I have the headers installed, they're just installed from source in /opt. It's obviously not looking there. How do I make it look there? For example, if this was configure, I could do something like "--with-mysql=/opt/mysql". It doesn't appear there is such an option with easy_install. Still researching so if I find my answer I'll post it here.

like image 920
user571658 Avatar asked Jan 20 '11 22:01

user571658


1 Answers

This looks more like an issue with the compiler search path than a easy_install issu.

Setting the include path environment variable before the easy_install call may work.

C_INCLUDE_PATH=/path/to/your/mysql/include/files easy_install intall MySQL-python

If that doesn't work, try setting the INCLUDE_PATH or CPLUS_INCLUDE_PATH variables. There wasn't enough easy_install output in the question to tell what compiler is being used.

like image 129
pwan Avatar answered Sep 21 '22 22:09

pwan