Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No acceptable C compiler found in $PATH when installing python

I'm trying to install a 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 the ./configure --prefix=/home/<user>/.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 I'm still stuck in one place.

UPDATE

Hostgator does not allow gcc on their shared accounts:

like image 315
mik.ro Avatar asked Oct 16 '22 16:10

mik.ro


People also ask

How do I know if GCC is installed on Linux?

If you want to check if the GNU GCC Compilers are install on your system, you can try to check the version of GCC compiler on Linux, or you can use which command to locate gcc or g++ commands . devops@devops-osetc:~$ gcc --version gcc (Ubuntu 5.4. 0-6ubuntu1~16.04.

How do I set GCC path in Windows 7?

In case you need a system/user-wide PATH change, go to Control Panel->System->Advanced->Environment variables, and add or modify PATH there. done that.


2 Answers

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
    
  • openSUSE base:

     zypper install --type pattern devel_basis
    
  • Alpine:

     apk add build-base
    
like image 617
vahid abdi Avatar answered Oct 19 '22 05:10

vahid abdi


You need to run

yum install gcc
like image 107
mlowton Avatar answered Oct 19 '22 04:10

mlowton