【问题标题】:Installation of Python and openssl --- without yumPython和openssl的安装---不用yum
【发布时间】:2021-04-14 11:25:01
【问题描述】:

尝试在 Linux 中为 python 3.8.3 安装 OpenSSL, make 给出以下错误

我已经添加了 .bashrc 和 .bash_profile 中所需的所有路径 我用过 /config 命令

''' ./configure --prefix=$Home/.local/python --with-openssl=$HOME/.local/ssl '''

Makefile:1884: warning: overriding commands for target `Modules/_ssl.o'
Makefile:1882: warning: ignoring old commands for target `Modules/_ssl.o'
Makefile:1885: warning: overriding commands for target `Modules/_ssl.cpython-38-x86_64-linux-gnu.so'
Makefile:1883: warning: ignoring old commands for target `Modules/_ssl.cpython-38-x86_64-linux-gnu.so'
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE_BUILTIN  -DUSE_SSL -IOME/.local/openssl1/include -IOME/.local/openssl1/include/openssl -c ./Modules/_ssl.c -o Modules/_ssl.o
./Modules/_ssl.c: In function ‘_ssl_configure_hostname’:
./Modules/_ssl.c:891: error: implicit declaration of function ‘SSL_get0_param’
./Modules/_ssl.c:891: warning: initialization makes pointer from integer without a cast
./Modules/_ssl.c:893: error: implicit declaration of function ‘X509_VERIFY_PARAM_set1_host’
./Modules/_ssl.c:899: error: implicit declaration of function ‘X509_VERIFY_PARAM_set1_ip’
./Modules/_ssl.c: In function ‘_ssl__SSLContext_impl’:
./Modules/_ssl.c:3130: error: ‘X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS’ undeclared (first use in this function)
./Modules/_ssl.c:3130: error: (Each undeclared identifier is reported only once
./Modules/_ssl.c:3130: error: for each function it appears in.)
./Modules/_ssl.c:3240: error: implicit declaration of function ‘SSL_CTX_get0_param’
./Modules/_ssl.c:3240: warning: assignment makes pointer from integer without a cast
./Modules/_ssl.c:3246: error: implicit declaration of function ‘X509_VERIFY_PARAM_set_hostflags’
./Modules/_ssl.c: In function ‘get_verify_flags’:
./Modules/_ssl.c:3555: warning: assignment makes pointer from integer without a cast
./Modules/_ssl.c: In function ‘set_verify_flags’:
./Modules/_ssl.c:3568: warning: assignment makes pointer from integer without a cast
./Modules/_ssl.c: In function ‘set_host_flags’:
./Modules/_ssl.c:3764: warning: assignment makes pointer from integer without a cast

【问题讨论】:

  • 您是否尝试同时编译 Python 3.8.3 和 OpenSSL?我相信如果您只是在 python 源目录中运行./configure,它将获取您的系统 ssl。您看到的错误表明 $HOME/.local/ssl 中的 openssl 已损坏或不完整。
  • 您实际使用您所说的特定configure 命令似乎极不可能。如果您准确地提供此类详细信息,您将更快地获得更好的答案。特别是,代码和命令通常应该被剪切和粘贴,而不是重新输入,因为重新输入非常频繁地会引入错误。

标签: python linux makefile openssl


【解决方案1】:

这个make 输出...

gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE_BUILTIN  -DUSE_SSL -IOME/.local/openssl1/include -IOME/.local/openssl1/include/openssl -c ./Modules/_ssl.c -o Modules/_ssl.o

... 表明您的configure 命令不是 ...

./configure --prefix=$Home/.local/python --with-openssl=$HOME/.local/ssl

特别是,我正在查看输出的这些位:

-IOME/.local/openssl1/include -IOME/.local/openssl1/include/openssl

。这显示了文本$HOME/.local/openssl1make 扩展为OME/.local/openssl1 的效果(因为没有定义变量H)。反过来,这表明$HOME 在您运行configure 时没有被shell 扩展,因此它必须在您运行的实际命令中被引用。可能是这样的:

(错误:)

./configure --prefix='$Home/.local/python' --with-openssl='$HOME/.local/openssl1'

另外,$Home$HOME 不一样,所以你真正想要的可能是:

(更好:)

./configure --prefix=$HOME/.local/python --with-openssl=$HOME/.local/openssl1

如果您使用引号,请使用双引号 ("),而不是单引号 ('),因为后者会抑制 shell 参数扩展。但是,如果您的主目录名称中有任何需要引用的内容,例如空格,那么无论您是否在 configure 命令中引用,您都可以预期会出现其他问题。

【讨论】:

    猜你喜欢
    • 2020-05-15
    • 1970-01-01
    • 2016-12-26
    • 2017-07-02
    • 2015-05-01
    • 2016-11-05
    • 1970-01-01
    • 2016-12-21
    • 1970-01-01
    相关资源
    最近更新 更多