1

I'm trying to install Python-3.6.5 on a machine that does not have any package manager installed, like apt-get or yum. I do have root access.

I can wget Python, but when I run the ./configure, I get the following error:

configure: error: no acceptable C compiler found in $PATH

Okay, so next I try to install GCC. I follow these instructions:

cd /bin
wget http://www.netgull.com/gcc/releases/gcc-4.8.5/gcc-4.8.5.tar.gz
tar -xvf gcc-4.8.5.tar.gz
cd gcc-4.8.5
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.5/configure --prefix=$HOME/gcc-4.8.5 --enable-languages=c,c++,fortran,go

And on that last command, I once again get:

configure: error: no acceptable C compiler found in $PATH

Lots of googling and reading led me to suggestion to add CC=/usr/bin/gcc like so:

CC=/usr/bin/gcc-x $PWD/../gcc-4.8.5/configure --prefix=$HOME/gcc-4.8.5 --enable-languages=c,c++,fortran

That gets me a new error:

configure: error: C compiler cannot create executables

Any ideas here? I'm really at a loss here, I've spent a long time trying to figure this one out and it's annoying me to no end.

smullan
  • 132
  • 3
  • 9
  • 1
    Can you post the relevant log output from the configure run? Also, something is *really* whack with your system if a proper C compiler is not in PATH. – LTClipp Jul 02 '18 at 19:18
  • 1
    Compile Python and/or GCC on a different system and copy the binaries onto yours. – that other guy Jul 02 '18 at 19:33
  • It would help if we knew what kind of Linux system this is. Something like this is *very* OS dependent. I could see it being Arch Linux though. Just a guess. –  Jul 02 '18 at 20:02
  • 1
    Read through `config.log` to see *why* it thinks your system-installed gcc is broken. Most likely, that system-installed gcc **is** in fact broken, and, well, not being able to compile things without a working compiler shouldn't be any kind of a surprise. – Charles Duffy Jul 02 '18 at 20:40
  • 1
    I kept fighting with it and it turns out gcc was installed but there was a stupid PATH problem that was causing the issue. I should have gone down that path (get it) sooner – smullan Jul 03 '18 at 13:52

1 Answers1

2

Try this

sudo apt-get install build-essential

It must be fix. (Referred here)

yEmreAk.com
  • 3,278
  • 2
  • 18
  • 37