mysql-python 安装问题
时间:2007-05-24 来源:ima
MySQL-python 1.2.2安装过程中
报错:
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 16, in ?
metadata, options = get_config()
File "/data/personal/henry/src/MySQL-python-1.2.2/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/data/personal/henry/src/MySQL-python-1.2.2/setup_posix.py", line 24, in mysql_config
raise EnvironmentError, "%s not found" % mysql_config.path
EnvironmentError: mysql_config not found
检查发现
setup_posix.py 中函数get_config()
根据metadata.cfg 和site.cfg中的配置信息初始化编译选项。
site.cfg中mysql_cfg 没有设置。
正确配置site.cfg,成功编译及安装。
但是调用接口时,报错:
File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 19, in ?
File "build/bdist.linux-i686/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-i686/egg/_mysql.py", line 6, in __bootstrap__
ImportError: /root/.python-eggs/MySQL_python-1.2.2-py2.4-linux-i686.egg-tmp/_mysql.so: undefined symbol: compress
检查链接选项,缺少 -lz,更正,一切顺利。
报错:
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 16, in ?
metadata, options = get_config()
File "/data/personal/henry/src/MySQL-python-1.2.2/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/data/personal/henry/src/MySQL-python-1.2.2/setup_posix.py", line 24, in mysql_config
raise EnvironmentError, "%s not found" % mysql_config.path
EnvironmentError: mysql_config not found
检查发现
setup_posix.py 中函数get_config()
根据metadata.cfg 和site.cfg中的配置信息初始化编译选项。
site.cfg中mysql_cfg 没有设置。
正确配置site.cfg,成功编译及安装。
但是调用接口时,报错:
File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 19, in ?
File "build/bdist.linux-i686/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-i686/egg/_mysql.py", line 6, in __bootstrap__
ImportError: /root/.python-eggs/MySQL_python-1.2.2-py2.4-linux-i686.egg-tmp/_mysql.so: undefined symbol: compress
检查链接选项,缺少 -lz,更正,一切顺利。
相关阅读 更多 +