Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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 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:

You should try to find prebuild binaries for your system. It's the easiest way if you don't have root access. – C. Yduqoli May 15, 2020 at 1:47

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
                    this is shared hosting, how is this even an accepted solution?  we need python, in come cases for node, which is also going in as user level, no root.  this is a deal breaker for all this, needing root.  this is supposed to be a non root procedure IMO
    – blamb
                    Dec 22, 2016 at 3:51
                    I'm getting the error "Error accessing file for config file:///etc/yum.conf". I have Bluehost shared hosting.
    – Paul Chris Jones
                    Mar 5, 2020 at 16:15
                    Hey @PaulChrisJones, I ran into same problem when I tried installing gcc in my blueshot hosting acc using ssh. I ran into this because my configure file woud not run. If you managed to find a solution please let me know. It would be of great help !
    – black sheep 369
                    May 27, 2020 at 12:51
                    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 <usrname>:  <usrname> is not in the sudoers file.  This incident will be reported.
    – mik.ro
                    Nov 6, 2013 at 15:46
                    Ok, i've checked hostgator website and the solution is very simple and sad: they don't allow gcc on their shared servers link If anyone has an idea, how can I install another python distribution on their shared hosting I'll appreciate it.
    – mik.ro
                    Nov 6, 2013 at 16:52
    

    sudo apt install build-essential is the command.

    However, 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.

    You would need to install it as non-root, since it's shared hosting. Here is a tutorial that goes through how to do this step.

    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 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
                    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 9, 2018 at 18:47
                    I got "configure: error: no acceptable C compiler found in $PATH" when executed $PWD... Is there a known solution???
    – Terry
                    Dec 22, 2018 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, 2021 at 21:26
                    I'm on a NAS drive. I don't have access to apt, yum or even dpkg. How can I install this file on a folder already pre-compiled so to speak. I believe the poster is describing compiling the application but unfortunately I can't compile the C compiler without a C compiler ....
    – Rookie
                    Aug 4, 2022 at 21:34
    

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

    I fixed the issue by executing the following command:

    yum install gcc
    

    to install gcc.

    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.

    In a shared hosting, gcc compiler is disabled by default (in a terminal write gcc --version and it must return 'Permission denied' if installed...). It's very important to the next step.

    Now, contact the support team and request to add your user id to 'compiler group'. This solves your problem and other - for example, you will be able to execute 'make' and 'make install' without problems, install the pillow library, etc.

    Forget about 'sudo' or 'apk' commands. They are also disabled by default.

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

  •