Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 210
emish Avatar asked Jan 15 '12 01:01

emish


1 Answers

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.

like image 52
echristo Avatar answered Sep 17 '22 14:09

echristo