question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The C compiler used to compile Python gcc-4.2, and which is normally used to compile C extensions, is not available.

See original GitHub issue

Running pip install --upgrade astropy throws:

The C compiler used to compile Python gcc-4.2, and
which is normally used to compile C extensions, is not
available. You can explicitly specify which compiler to
use by setting the CC environment variable, for example:
    
    CC=gcc python setup.py <command>
    
or if you are using MacOS X, you can try:
    
    CC=clang python setup.py <command>
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-mwnzXX/astropy/

I found a workaround by linking gcc-4.2 to clang: sudo ln -s /usr/bin/clang /usr/bin/gcc-4.2 I was wondering why the installer is trying to compile with a c compiler that is no longer supported on OS X and is pretty outdated on other systems.

Successful and unsuccessful logs attached. astropy-install-successful.txt astropy-install-unsuccessful.txt

My suggestion to solve this issue would be to use the environment c compiler by default rather than running a workaround to do so when the install fails. The original c compiler for python is clearly not needed to compile and run astropy properly, so the environment c compiler will do just fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
astrofrogcommented, Apr 19, 2017

@bsmith18 - did you try the suggested workaround? I think it might work with pip too, so:

CC=clang pip install astropy --upgrade

Any luck?

1reaction
pllimcommented, Apr 28, 2017

Unless someone has an idea how to fix this, I propose we mark this as “won’t fix” and move on. Since @mdboom and @embray couldn’t figure it out all those years ago, I am not very optimistic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue 12641: Remove -mno-cygwin from distutils
msg141172 ‑ (view) Author: Jon (jonforums) Date: 2011‑07‑26 17:02 msg141173 ‑ (view) Author: Ruben Van Boxem (rubenvb) Date: 2011‑07‑26 18:06 msg141230 ‑ (view) Author: Éric...
Read more >
Building from source — NumPy v1.23 Manual
There are two options for building NumPy- building with Gitpod or locally from ... Much of NumPy is written in C. You will...
Read more >
Building Python C extension modules for Windows
You can use both MinGW and VC++ Express (free, no need to buy it). See: http://eli.thegreenplace.net/2008/06/28/compiling-python-extensions- ...
Read more >
Build systems - pybind11 documentation
CXX="cache g++" pip install -e . would be the way to use it with GCC, for example. Unlike the simple solution, this even...
Read more >
Writing R Extensions - The Comprehensive R Archive Network
There is also the possibility of 'byte' compiling the R code in a package (using ... Do not repeat the package name: it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found