不能让 python 编译器指向 openSSL

问题描述 投票:0回答:0

我试图让我的 python 编译器指向 openSSL(mac 和 vs code dev),因为我在编译我的代码时遇到了这个错误:

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168
我正在尝试关注另一个 post,它使用
./configure
命令设置 CPPFLAGS 和 LDFLAGS。 (我曾经尝试将它导出到我的 ./zshrc 文件中的 PATH 变量中,但它不起作用)

LDFLAGS="-L/opt/homebrew/opt/openssl/lib"
CPPFLAGS="-I/opt/homebrew/opt/openssl/include"

我的 python3 设置中没有

./configure
exec。唯一的 configure exec 是 python3-config 但它不支持任何 configure set 命令。任何人都知道我应该如何找到解决方法来解决它?谢谢

python3-config CPPFLAGS="-I/opt/homebrew/opt/openssl/include"
(Not work) Usage: /opt/homebrew/bin/python3-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed]

使用 python3-config,似乎只支持查询标志但不支持设置标志。

python openssl flags
© www.soinside.com 2019 - 2024. All rights reserved.