安装MySQL_python 1.2.2(Mac OS 10.6 Snow Leopard)时出现GCC错误

2024-05-13 06:54:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在雪豹上安装MySQL_python1.2.2(我特别需要这个版本,而不是当前的1.2.3),并得到以下错误。在

要安装的命令:

pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download

还有一部分痕迹:

^{pr2}$

以前有人见过这个错误吗?在


Tags: installpip命令版本httpnet错误mysql
2条回答

正如错误所说,事情已经被重新定义了。在过去,我通过注释掉正在构建的库的源代码中有问题的声明来解决这个问题。但是这个解决方案有一些明显的问题。。。在

谷歌快速搜索得到this answer

To get mysqldb working on leopard I found I had to edit _mysql.c and edit out the lines:

#ifndef uint
#define uint unsigned int
#endif     

I also had to edit site.cfg and mark threadsafe to False.

After doing this, I managed to get MySQLdb to install, great! Not so fast, there was yet another problem:

Referenced from: .../_mysql.so Reason: image not found

The solution:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

相关问题 更多 >