【发布时间】:2020-12-25 11:19:52
【问题描述】:
我正在尝试使用 CygWin 的最新版本在 Windows 10 上编译一个库 (libWally)。 (Automake 11-1,Autoconf 13-1)。运行命令 ./configure 给我下面的错误。我的 Python 版本是 3.8.5,远高于脚本要求的最低 2.1.0。不确定 configure 是否找到了错误的版本或有其他错误,并且在阅读 configure.log 文件以确定发生了什么方面不够熟练。
This version of the AC_PYTHON_DEVEL macro
doesn't work properly with versions of Python before
2.1.0. You may need to re-run configure, setting the
variables PYTHON_CPPFLAGS, PYTHON_LIBS, PYTHON_SITE_PKG,
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
to something else than an empty string.
编辑:在 bash 中,我将环境变量 PYTHON_VERSION 设置为“3.8.5”,然后重新运行。版本检查错误消失,但随后告诉我在系统路径中找不到“Python3.8.5”。由于我机器上的 Python 安装在“./Python38”目录中,我将变量更改为“38”,但它仍然告诉我在系统路径中找不到 Python38。然而,它就在那里。配置文件的相关部分似乎是这样的:
set dummy python$PYTHON_VERSION; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PYTHON=$ac_cv_path_PYTHON
if test -n "$PYTHON"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$PYTHON"; then
as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5
再次编辑:将 bash 中的 PYTHON var 设置为 Python 的路径解决了路径错误,但导致原始版本错误再次出现。我包括那个配置部分:
if test -n ">= '2.7.0'"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.7.0'" >&5
$as_echo_n "checking for a version of Python >= '2.7.0'... " >&6; }
ac_supports_python_ver=`$PYTHON -c "import sys; \
ver = sys.version.split ()[0]; \
print (ver >= '2.7.0')"`
if test "$ac_supports_python_ver" = "True"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
as_fn_error $? "this package requires Python >= '2.7.0'.
If you have it installed, but it isn't the default Python
interpreter in your system path, please pass the PYTHON_VERSION
variable to configure. '''
【问题讨论】:
-
如果不了解您在此处编写的内容,可能脚本需要 Python 2 版本。请记住,Python 2 和 Python 3 非常不同,大多数为 Python 2 编写的 Python 脚本不会在 Python 3 中工作(无需修改)。所以也许这个脚本正在寻找 Python 2,并且在找到 Python 3 时只是打印一条令人困惑的消息。但是,您在这里没有提供足够的信息让任何人真正知道问题出在哪里是。
-
感谢您的回复。我发布了配置文件中可能相关的部分。您还可以建议我提供什么来为人们提供更多信息?
-
请谨慎处理您的案件。 POSIX 系统区分大小写,因此
Python38与python38不同。您有两个标签linux和cygwin,这令人困惑。您说“Python38 出现在系统路径上”,然后您说“安装在 ./Python38 目录中”。总而言之,您的描述有点随意,您没有向我们展示您的实际 PATH 值、Python 的完全限定位置等。 -
从上面的配置脚本部分看起来你可以设置
PYTHON=/path/to/python,它只会使用那个python解释器:你试过了吗? -
将 Cygwin 工具(automake、automake..)与 Windows Python 混合使用会引发问题,因为它们管理不同的行终止和其他内容(CRLF 与 LF ..)
标签: linux gcc makefile cygwin autoconf