![](/img/trans.png)
[英]Installing Python 3.8.1 --with-openssl --without-root/apt/yum
[英]Installation of Python and openssl — without yum
試圖在 Linux 中為 python 3.8.3 安裝 OpenSSL,給出以下錯誤
我已經在.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
這make
output...
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
特別是,我正在查看 output 的這些位:
-IOME/.local/openssl1/include -IOME/.local/openssl1/include/openssl
. 這顯示了文本$HOME/.local/openssl1
被make
擴展為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
命令中引用,都可以預期會出現其他問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.