Skip to content

Instantly share code, notes, and snippets.

@SHDShim
Last active July 3, 2019 02:57
Show Gist options
  • Save SHDShim/1f1e626b070a5bb78d0f8149253cc7e6 to your computer and use it in GitHub Desktop.
Save SHDShim/1f1e626b070a5bb78d0f8149253cc7e6 to your computer and use it in GitHub Desktop.
What to do if pip fails because of c compile problem in MacOS

If pip fails because of c compile problem in MacOS

Remove gcc in conda and run pip. gcc should be removed from the base environment.

Also, run the following in the terminal for updating xcode.

sudo open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Basically, pip should use MacOS native gcc compiler not conda gcc compiler.

Even more extreme base, you may need to remove existing commandline tools and reinstall. See instruction at: https://stackoverflow.com/questions/34617452/how-to-update-xcode-from-command-line


(before 2019/04/12)

brew install gcc
export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8
export CXX=/usr/local/Cellar/gcc/8.2.0/bin/g++-8

It is possible that you need to reinstall gcc in brew after changing some setups.

brew reinstall gcc

Source: SeanNaren/warp-ctc#58 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment