Why does the pip installer expect gcc-4.2 to be the name of the gcc compiler in OS X Lion?

StackOverflow https://stackoverflow.com/questions/8866804

문제

When installing packages in Python using pip, I came across the following error:

unable to execute gcc-4.2: No such file or directory

Clearly, pip is trying to use gcc-4.2 which is not in any of the binary directories, namely /usr/bin. After looking around this site and others, I have found that many others are suffering from the same issue. However, gcc is updated to version 4.2 in OS X Lion and this is not a version problem, rather, gcc is just called gcc, not gcc-4.2, under /usr/bin, and is symlinked to llvm-gcc. After adding gcc-4.2 in /usr/bin as a symlink to gcc, pip was able to install everything successfully. Why is it then, that pip is looking for gcc-4.2 and not gcc? Is this the fault of pip, OS X Lion, or the packages within pip that are trying to install themselves with gcc-4.2?

Finally, is my symlink hack the right thing to do in this situation, or should I have fixed this some other way?

도움이 되었습니까?

해결책

Your simlink hack is the right solution for now. Ultimately the people who support pip for the platform need to stop using explicit versions of the compiler that way. It was a bad idea to begin with and will only be worse as compilers on the platform change.

Contrary to Milad's answer there are other solutions to determining version in the host compiler and your solution will work until the people who support pip on the platform fix their code.

다른 팁

You symlink hack is the right solution for you. pip is just trying to ensure that it is being installed using the right version of GCC. Since your computer is equipped with that version, it is safe for you to point it to your available gcc as the one it is looking for. But if, say, you had gcc-4.1 your installation might have gone places it shouldn't have.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top