GCC-4.2 error on Mac OS-X Mountain Lion, unable to install some packages with pip / virtualenv

非 Y 不嫁゛ 提交于 2019-12-04 01:40:12

Same problem with pycrypto install failing to compile in a virtualenv. Found the solution in this thread by poster jiaaro: https://gist.github.com/3179227#gistcomment-379913

You need to install Xcode 4.4 (from the app store) and then, within xcode open Xcode > Preferences (or press Cmd + ,) then open the downloads tab and install the Command Line Tools.

On Mac OSx Mountain Lion 10.8 I had xCode 4.3 installed WITH the command line tools. I did the update to xCode 4.4 and it still didn't work. Xcode does not automatically download the new command line tools apparently even if you had them installed. As the post from jiaaro states, you have to explicitly download the command line tools again.

Current version of gcc is below and does successfully sudo pip install packages in virtualenv for me with no need to sym link.

gcc

i686-apple-darwin11-llvm-gcc-4.2

Setting this environmental variable did it for me, without the need to mess around with Xcode or it's downloads.

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

Not sure if this might help but maybe it's worth a try:

https://gist.github.com/3179227

So I've resolved this issue from myself, but I kinda live in the wild west where I fix things now and worry about the correct way to do it when things break. I just made a symbolic link so that stdargs.h is in a reasonable location where it will be seen when requested.

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdarg.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdarg.h

You may have to alter "MacOSX10.8.sdk" to be the one you're currently using. Hopeful

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!