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 issueRunning 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:
- Created 6 years ago
- Comments:18 (10 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bsmith18 - did you try the suggested workaround? I think it might work with pip too, so:
Any luck?
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.