python - 在 $PATH 中找不到可接受的 C 编译器 - 安装 Python 和 GCC

标签 python linux gcc

我正在尝试在没有安装任何包管理器(如 apt-get 或 yum)的机器上安装 Python-3.6.5。我确实有 root 访问权限。

我可以 wget Python,但是当我运行 ./configure 时,出现以下错误:

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

好的,接下来我尝试安装 GCC。我关注these instructions :

cd /bin
wget http://www.netgull.com/gcc/releases/gcc-4.8.5/gcc-4.8.5.tar.gz
tar -xvf gcc-4.8.5.tar.gz
cd gcc-4.8.5
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.5/configure --prefix=$HOME/gcc-4.8.5 --enable-languages=c,c++,fortran,go

在最后一个命令中,我再次得到:

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

大量的谷歌搜索和阅读让我建议像这样添加 CC=/usr/bin/gcc:

CC=/usr/bin/gcc-x $PWD/../gcc-4.8.5/configure --prefix=$HOME/gcc-4.8.5 --enable-languages=c,c++,fortran

这给我带来了一个新的错误:

configure: error: C compiler cannot create executables

这里有什么想法吗?我真的很茫然,我花了很长时间试图弄清楚这个问题,这让我很恼火。

最佳答案

试试这个

sudo apt-get install build-essential

必须修好。 (引用here)

关于python - 在 $PATH 中找不到可接受的 C 编译器 - 安装 Python 和 GCC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51142399/

相关文章:

python - 用于重命名以空格或句点结尾的文件夹的递归脚本

linux - Makefile.am ...那些是什么?

RAW套接字可以绑定(bind)到ip :port instead of an interface?吗

gcc - ARMv8 NEON GCC 内在函数

python - 如何在单行中按模对列表进行排序

python - 使用自定义 HeaderView 时列排序不起作用

python - 如何在 Python 中循环遍历字符列表并将其替换为 "_"?

python - 在 Raspi 上从 cron 运行时测试的 python 程序失败

c++ - GCOV:使用 GCC 构建时 --coverage 和 --ftest-coverage 有什么区别?

c++ - 如何设置 CMAKE 静态链接(对 `dlopen' 的 undefined reference )?