278

I'm trying to install new python environment on my shared hosting. I follow the steps written in this post:

mkdir ~/src
wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz
tar -zxvf Python-2.7.1.tar.gz
cd Python-2.7.1
mkdir ~/.localpython
./configure --prefix=/home/<user>/.localpython
make
make install

After coming to "./configure --prefix=/home//.localpython" command I get the following output:

checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux3
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home3/mikos89/Python-2.7.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

How can this problem be solved? I've been trying to find a solution for 3 hours but still stuck in one place.

UPDATE

Hostgator does not allow gcc on their shared accounts: http://support.hostgator.com/articles/pre-sales-questions/compatible-technologies

Promise Preston
  • 8,732
  • 5
  • 43
  • 70
mik.ro
  • 3,381
  • 2
  • 15
  • 22

11 Answers11

510

The gcc compiler is not in your $PATH. It means either you dont have gcc installed or it's not in your $PATH variable.

To install gcc use this: (run as root)

  • Redhat base:

    yum groupinstall "Development Tools"
    
  • Debian base:

    apt-get install build-essential
    
vahid abdi
  • 7,840
  • 4
  • 27
  • 33
91

you need to run

yum install gcc
mlowton
  • 910
  • 6
  • 4
73

for Ubuntu / Debian :

# sudo apt-get install build-essential

For RHEL/CentOS

#rpm -qa | grep gcc
# yum install gcc glibc glibc-common gd gd-devel -y

or

 # yum groupinstall "Development tools" -y

More details refer the link

lakshmikandan
  • 3,560
  • 2
  • 23
  • 33
64

You will need to run

sudo apt-get install build-essential

first assuming you're on a debain/ubuntu system

Tom Swifty
  • 2,614
  • 2
  • 12
  • 25
  • 1
    I got this response after typing your code: sudo: unable to mkdir /var/db/sudo: No such file or directory We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for : is not in the sudoers file. This incident will be reported. – mik.ro Nov 06 '13 at 15:46
  • 1
    which distro are you using? – vahid abdi Nov 06 '13 at 15:50
  • @mik.ro what OS/distribution are you running. Are you logged in as root by any chance? – Tom Swifty Nov 06 '13 at 16:00
  • i'm using hostgator, it's on CentOS x86. – mik.ro Nov 06 '13 at 16:28
  • @TomSwifty I got the mentioned message every time I want to login as a root. I'm gonna contact hostgator to clarify it. – mik.ro Nov 06 '13 at 16:40
  • 1
    Ok, i've checked hostgator website and the solution is very simple and sad: they don't allow gcc on their shared servers [link](http://support.hostgator.com/articles/pre-sales-questions/compatible-technologies) If anyone has an idea, how can I install another python distribution on their shared hosting I'll appreciate it. – mik.ro Nov 06 '13 at 16:52
17

sudo apt install build-essential is the command

But if you get the "the package can be found" kind of error, Run

  • sudo apt update first
  • then sudo apt install build-essential

This worked for me.

Mbigha Siggi
  • 311
  • 2
  • 4
14

You would need to install it as non root, since its shared hosting. Here is a tut that points how this step. http://luiarthur.github.io/gccinstall

cd ~/src
wget http://www.netgull.com/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.gz

or equivalent gcc source, then

tar -xvf gcc-5.2.0.tar.gz
cd gcc-5.2.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-5.2.0/configure --prefix=$HOME/gcc-5.2.0 --enable-languages=c,c++,fortran,go
make
make install

then add to .bashrc, or equivalent

export PATH=~/gcc-5.2.0/bin:$PATH
export LD_LIBRARY_PATH=~/gcc-5.2.0/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=~/gcc-5.2.0/lib64:$LD_LIBRARY_PATH
blamb
  • 3,752
  • 3
  • 28
  • 44
  • 13
    when execute `$PWD/../gcc-5.2.0/configure --prefix=$HOME/gcc-5.2.0 --enable-languages=c,c++,fortran,go` still result the same error **configure: error: no acceptable C compiler found in $PATH** – Tony Chou Feb 09 '18 at 18:47
  • 1
    I got "configure: error: no acceptable C compiler found in $PATH" when executed $PWD... Is there a known solution??? – Terry Dec 22 '18 at 13:19
  • I had a similar issue when using Bluehost's hosting services. I had to call support to request to be added to their compiler group(which they have an example for enabling python). After they granted it, I was able to call make, which is currently still compiling after an hour. – Ashitakalax Jan 10 '21 at 21:26
13

If you are using alphine with docker, do this:

apk --update add gcc make g++ zlib-dev
Sahith Vibudhi
  • 3,207
  • 1
  • 20
  • 25
11

Issue :

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

Fixed the issue by executing the following command:

yum install gcc

to install gcc.

vinzee
  • 10,965
  • 9
  • 34
  • 51
9

Get someone with access to the root account on that server to run sudo apt-get install build-essential. If you don't know who has root access, contact the support team for your shared hosting and ask them.

Edit: If you aren't allowed access to root, you aren't ever going to get it working. You'll have to change hosting provider I'm afraid.

wdh
  • 1,432
  • 11
  • 15
9

Run apt-get install gcc in Suse Linux

Black
  • 12,789
  • 26
  • 116
  • 196
5

On Arch Linux run the following:

sudo pacman -S base-devel

Timo Giese
  • 55
  • 8
user6735634
  • 59
  • 1
  • 1