python easy_install:指定存放必需文件的目录 [英] python easy_install: specify directory housing required files
问题描述
我正在尝试使用easy_install安装MySQL-python.它几乎立即失败:
I'm trying to use easy_install to install MySQL-python. It fails almost immediately:
_mysql.c:36:23:错误:my_config.h:没有这样的文件或目录
_mysql.c:38:19:错误:mysql.h:没有这样的文件或目录
_mysql.c:39:26:错误:mysqld_error.h:没有这样的文件或目录
_mysql.c:40:20:错误:errmsg.h:没有这样的文件或目录
_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
找不到标题.我已经安装了标头,它们只是从/opt中的源安装的.显然不在那儿.我如何让它看起来在那里?例如,如果已配置,则可以执行"--with-mysql =/opt/mysql"之类的操作. easy_install似乎没有这样的选项.仍在研究中,如果我找到答案了,我会在这里发布.
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.
推荐答案
与easy_install发行版相比,这更像是编译器搜索路径的问题.
This looks more like an issue with the compiler search path than a easy_install issu.
在easy_install调用可能起作用之前设置包含路径环境变量.
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
如果这不起作用,请尝试设置INCLUDE_PATH或CPLUS_INCLUDE_PATH变量.问题中的easy_install输出不足,无法告诉您正在使用什么编译器.
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.
这篇关于python easy_install:指定存放必需文件的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!