我正在尝试在我的共享主机上安装新的 Python 环境。我按照 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
来到./configure --prefix=/home/<user>/.localpython
后命令,我得到以下输出:
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.
如何解决这个问题?我已经尝试了 3 个小时来寻找解决方案,但我仍然卡在一个地方。
更新
Hostgator does not allow gcc在他们的共享帐户上:
最佳答案
gcc 编译器不在您的 $PATH
中。
这意味着要么你没有安装 gcc,要么它不在你的 $PATH 变量中。
要安装 gcc,请使用:(以 root 身份运行)
红帽基地:
yum groupinstall "Development Tools"
Debian 基础:
apt-get install build-essential
openSUSE 基础:
zypper install --type pattern devel_basis
阿尔卑斯山:
apk add build-base
https://stackoverflow.com/questions/19816275/