安装 python 时在 $PATH 中找不到可接受的 C 编译器

2023-12-14

我正在尝试在我的共享主机上安装新的 Python 环境。我按照中写的步骤操作这个帖子:

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个小时试图找到解决方案,但我仍然停留在一个地方。

UPDATE

主机加托不允许海湾合作委员会在他们的共享帐户上:


你的 gcc 编译器不在$PATH。 这意味着您没有安装 gcc 或者它不在您的 $PATH 变量中。

要安装 gcc,请使用:(以 root 身份运行)

  • 红帽基础:

     yum groupinstall "Development Tools"
    
  • Debian 基础:

     apt-get install build-essential
    
  • openSUSE 基础:

     zypper install --type pattern devel_basis
    
  • Alpine:

     apk add build-base
    
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

安装 python 时在 $PATH 中找不到可接受的 C 编译器 的相关文章

随机推荐