OS X Mountain Lion: gcc-4.2 No such file or directory

后端 未结 4 1056
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 04:34

Tried to install a gem on Mountain Lion and make couldn\'t find gcc-4.2:

kamil$ gem install posix-spawn -v \'0.3.6\'
Building native extensions.  This could          


        
4条回答
  •  我在风中等你
    2020-12-08 05:11

    I had a similar issue while installing a python pip package (building a wheel failed). I got the similar message:

    unable to execute '/usr/bin/gcc-4.2': No such file or directory
      error: command '/usr/bin/gcc-4.2' failed with exit status 1
    

    Linking /usr/bin/gcc-4.2 to /usr/bin/gcc was not possible due to Apples System Integrity Protection (SIP), and linking it to /usr/local/bin/gcc-4.2 was not picked up by the wheel building process; it was still trying to use /usr/bin/gcc-4.2.

    I was finally able to solve this by setting the CC variable in the terminal:

    CC=/usr/bin/gcc
    # Install your packages
    pip install -r requirements.txt
    

    PS : note that disabling SIP doesn't work, even with SIP disabled I wasn't able to create the /usr/bin/gcc-4.2 link.

提交回复
热议问题