mac下安装mysql-python失败,求解决办法
我的mac是10.9.2的,mysql用的是mamppro(是一个phpapachemysql)集成环境(我把mysql、mysql_config拷到了/usr/loca...
我的mac是10.9.2的,mysql用的是mamp pro(是一个php apache mysql)集成环境(我把mysql、mysql_config拷到了/usr/local/bin/中),python是自带的2.7.5,使用
sudo easy_install mysql-python 安装,显示错误为
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.5
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Processing MySQL-python-1.2.5.zip
Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gkrPD5/MySQL-python-1.2.5/egg-dist-tmp-_SQasB
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: Setup script exited with error: command 'cc' failed with exit status 1
求高手指点下怎么解决
我的mysql和python都有
➜ ~ which mysql
/usr/local/bin/mysql
➜ ~ which python
/usr/bin/python 展开
sudo easy_install mysql-python 安装,显示错误为
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.5
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Processing MySQL-python-1.2.5.zip
Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gkrPD5/MySQL-python-1.2.5/egg-dist-tmp-_SQasB
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: Setup script exited with error: command 'cc' failed with exit status 1
求高手指点下怎么解决
我的mysql和python都有
➜ ~ which mysql
/usr/local/bin/mysql
➜ ~ which python
/usr/bin/python 展开
1个回答
展开全部
试试看:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install MySQL-python
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install MySQL-python
更多追问追答
追问
还是报错
clang: warning: argument unused during compilation: '-mno-fused-madd'
_mysql.c:44:10: fatal error: 'my_config.h' file not found
追答
这个错误是找不到my_config.h这个编译所需的头文件
两种可能
1:NAMP安装了mysql的开发环境,但没有添加到标准include路径中
解决方法:添加进去即可
2:NAMP没有安装mysql的开发环境,只安装了mysql的生产环境,
解决方法:
去看NAMP的文档,看看是不是安装的时候有选项可以把开发环境安装进去
自己来弄,去mysql官网下源码包,编译,不要用自己下的这个去搭建数据库,只用他的lib和头文件,然后指定好include目录和lib目录后,再编译安装mysql-python
看看有谁的mac系统,有合适的环境,python版本号一定要一致,mysql版本差一点点一般没关系让他帮忙用类似python setup.py bdist之类的命令,带你做个包,你装下一般就行了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询