Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc-4.2 failed with exit status 1

I've been looking for an answer to this issue but I couldn't find it, so here it is.

I'm trying to install Uniconvertor with a setup.py file into a MacOS X Lion (Python 2.7.2) using:

python setup.py install

Then I get the following error code:

running install
running build
running build_py
running build_ext
building 'uniconvertor.app.modules.streamfilter' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -DMAJOR_VERSION=1 -DMINOR_VERSION=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/modules/filter/streamfilter.c -o build/temp.macosx-10.6-intel-2.7/src/modules/filter/streamfilter.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1

I looked for the 'gcc-4.2' file in the Developer/usr/bin folder and it wasn't there, but there's a 'llvm-gcc.4.2' file that makes me think I should change the compiler from 'gcc-4.2' to the 'llvm-gcc.4.2' one.

I'm kind of new to Mac and I don't know how else to fix it.

Thanks.

Edit:

I tried using:

cd /Developer/usr/bin
ln -s llvm-gcc-4.2 gcc-4.2

And I get a little more progress, but then a new error:

running install_lib
creating /Library/Python/2.7/site-packages/uniconvertor
error: could not create '/Library/Python/2.7/site-packages/uniconvertor': Permission denied

What could be the cause of this 'Permission denied'?

I'm running it into an Admin account and it doesn't ask for a password or anything.

Thank you again.

like image 571
valcox3 Avatar asked Dec 12 '11 10:12

valcox3


3 Answers

Try the following:

  1. Install the latest Xcode.
  2. From Xcode's Preferences menu, install the Command Line Tools (Downloads/Components tab).
like image 168
jeffmaher Avatar answered Nov 20 '22 09:11

jeffmaher


I was able to resolve this by downloading one of these: https://github.com/kennethreitz/osx-gcc-installer/releases

like image 42
Ricky Sahu Avatar answered Nov 20 '22 07:11

Ricky Sahu


For newer versions of OS X (including macOS), you just need to open up a terminal and type:

xcode-select --install
like image 5
Brideau Avatar answered Nov 20 '22 08:11

Brideau