【问题标题】:Problem installing cryptography on MacOS Monterey with ARM chip在带有 ARM 芯片的 MacOS Monterey 上安装密码学时出现问题
【发布时间】:2022-07-05 20:11:46
【问题描述】:

我正在尝试在装有运行 Monterey MacOS 的 ARM 芯片的 MacBook 上安装加密包。我发出的命令是

pip3 install cryptography --global-option=build_ext 
  --global-option="-L/opt/homebrew/Cellar/openssl@1.1/1.1.1m/lib/"
  --global-option="-I/opt/homebrew/Cellar/openssl@1.1/1.1.1m/include"

我收到错误:

build/temp.macosx-10.14-arm64-3.8/_openssl.c:575:10: 
   fatal error: '***openssl/opensslv.h***' file not found

#include <openssl/opensslv.h>。我在/opt/homebrew/Cellar/openssl@1.1/1.1.1m/include/ 下肯定有那个文件,并且那个目录在我的路径中。请告诉我我做错了什么。

【问题讨论】:

    标签: python-3.x openssl


    【解决方案1】:

    我遇到了同样的问题。

    尝试使用 brew 安装 openssl

    brew 安装 openssl

    ,那么真正的诀窍在于密码学的文档:https://cryptography.io/en/latest/installation/

    brew install openssl@1.1 rust

    env LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" CFLAGS="-I$(brew --prefix openssl@1.1)/include" pip3 install cryptography

    不要忘记在命令末尾根据需要调整 pip/pip3 和密码学的版本。

    希望它也适用于您! :)

    【讨论】:

      猜你喜欢
      • 2022-10-20
      • 2021-12-23
      • 2022-08-12
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      • 2022-08-18
      • 2023-02-10
      • 2021-09-01
      相关资源
      最近更新 更多