Python:Xcode不再允许pip安装mysql Python。需要解决的问题
今天早上我在Mac上安装mysql python连接器时遇到了一些大问题 问题在于xcode 5.1的最新更新: 但是,我已经尝试了当前的解决方法,但仍然出现错误:Python:Xcode不再允许pip安装mysql Python。需要解决的问题,python,django,xcode,Python,Django,Xcode,今天早上我在Mac上安装mysql python连接器时遇到了一些大问题 问题在于xcode 5.1的最新更新: 但是,我已经尝试了当前的解决方法,但仍然出现错误: cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-p
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
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: command 'cc' failed with exit status 1
这就是我尝试过的:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future sudo pip install mysql-python
这就是错误:
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
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: command 'cc' failed with exit status 1
有人遇到过同样的问题,并且知道在虚拟环境中可以使用的解决方案吗 我在你的第一个链接上写了这篇文章。我不是100%确定,但我认为问题在于sudo的使用。变量在您的用户下设置,而pip命令提升为root权限,即在另一个用户下执行。试着从一开始就以root用户的身份登录,不要使用sudo。我在你的第一个链接上写了这篇文章。我不是100%确定,但我认为问题在于sudo的使用。变量在您的用户下设置,而pip命令提升为root权限,即在另一个用户下执行。尝试从一开始就以root用户身份登录,而不使用sudo。是的,成功了!谢谢你的回答和文章!因为这个问题,我也找到了pymysql!很容易安装,我只是在我的设置中添加了pymysql.install_as_MySQLdb(),我不需要其他连接器@棒极了!很高兴它起了作用:)是的,它起作用了!谢谢你的回答和文章!因为这个问题,我也找到了pymysql!很容易安装,我只是在我的设置中添加了pymysql.install_as_MySQLdb(),我不需要其他连接器@棒极了!很高兴这有帮助:)