gpt4 book ai didi

python - centOS 7 - 安装 Python 3 的困难

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:55:54 26 4
gpt4 key购买 nike

我有一个全新的 centOS 7 虚拟机,它正在尝试安装 Python 3(目前为 3.6.0)。我正在遵循 Daniel Eriksson ( https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/ ) 的指南

但我在运行 make && make altinstall 命令时遇到了 Pemission denied 错误。

我得到的错误的最后一部分在这里:

gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   -I. -I./Include   -fPIC -DPy_BUILD_CORE -o Programs/_testembed.o ./Programs/_testembed.c
gcc -pthread -Wl,-rpath /usr/local/lib -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o -L. -lpython3.6m -lpthread -ldl -lutil -lm
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
sed -e "s,@EXENAME@,/usr/local/bin/python3.6m," < ./Misc/python-config.in >python-config.py
# Replace makefile compat. variable references with shell script compat. ones; ->
LC_ALL=C sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh >python-config
# On Darwin, always use the python version of the script, the shell
# version doesn't use the compiler customizations that are provided
# in python (_osx_support.py).
if test `uname -s` = Darwin; then \
cp python-config.py python-config; \
fi
if test "no-framework" = "no-framework" ; then \
/bin/install -c python /usr/local/bin/python3.6m; \
else \
/bin/install -c -s Mac/pythonw /usr/local/bin/python3.6m; \
fi
/bin/install: cannot create regular file ‘/usr/local/bin/python3.6m’: Permission denied
make: *** [altbininstall] Error 1

我通常不使用 Linux,所以我不确定去哪里寻找或下一步尝试什么。对此的任何帮助表示赞赏。谢谢

最佳答案

问题在于运行安装包的命令时所需的权限。

使用
sudo make && sudo make altinstall

代替:
sudo make && make altinstall

关于python - centOS 7 - 安装 Python 3 的困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43237949/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com