简体   繁体   English

在 Apple Silicon 上运行的 Big Sur 上安装加密时出错

[英]Error installing cryptography on Big Sur running on Apple Silicon

I've tried to install cryptography on my brand new Air M1.我试图在我全新的 Air M1 上安装密码学。 But something goes wrong.但是出了点问题。 I already tried some solutions from google but it didn't help.我已经尝试了谷歌的一些解决方案,但没有帮助。

Environment Details:环境细节:

  • Python 3.9.1 Python 3.9.1
  • pip 21.0.1 pip 21.0.1
  • macOS BigSur 11.2 Appl1 M1 macOS BigSur 11.2 Appl1 M1
  • cffi==1.14.5 cffi==1.14.5
  • openssl@1.1 openssl@1.1

Steps to reproduce:重现步骤:

pip3 install cryptography

traceback:追溯:

  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.macosx-11-arm64-3.9/cryptography/hazmat/bindings/openssl
  running egg_info
  writing src/cryptography.egg-info/PKG-INFO
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing requirements to src/cryptography.egg-info/requires.txt
  writing top-level names to src/cryptography.egg-info/top_level.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files found matching 'mypy.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  copying src/cryptography/py.typed -> build/lib.macosx-11-arm64-3.9/cryptography
  running build_ext
  generating cffi module 'build/temp.macosx-11-arm64-3.9/_padding.c'
  creating build/temp.macosx-11-arm64-3.9
  generating cffi module 'build/temp.macosx-11-arm64-3.9/_openssl.c'
  running build_rust

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      4) Ensure you have a recent Rust toolchain installed:
         https://cryptography.io/en/latest/installation.html#rust
      5) If you are experiencing issues with Rust for *this release only* you may
         set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
      =============================DEBUG ASSISTANCE=============================

  error: Can not find Rust compiler
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

it works for me after fresh updates.新更新后它对我有用。

sudo xcode-select --install.

Rust currently works on m1 via Rust 目前在 m1 上通过

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

However you will most likely experience another error after fixing rust.但是,在修复 rust 后,您很可能会遇到另一个错误。

import _cffi_backend as backend ImportError: dlopen(/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.x/site-packages/_cffi_backend.cpython-3X-darwin.so, 2): no suitable image found.导入 _cffi_backend 作为后端 ImportError: dlopen(/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.x/site-packages/_cffi_backend.cpython-3X-darwin.so , 2): 没有找到合适的图像。 Did find: /private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.X/site-packages/_cffi_backend.cpython-3X-darwin.so: mach-o, but wrong architecture确实找到了:/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.X/site-packages/_cffi_backend.cpython-3X-darwin.so:mach-o,但错误的架构

The issue is discussed here where it's stated that CFFI maintainers don't support m1 macs: https://github.com/gevent/gevent/issues/1721此处讨论了该问题,其中指出 CFFI 维护者不支持 m1 mac: https://github.com/gevent/gevent/issues/1721

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python 密码学未在 Apple Silicon M1 PRO 上安装 pkcs7 - python cryptography not installing pkcs7 on Apple Silicon M1 PRO 枕头未安装在 Apple Silicon 上 - Pillow Not installing on Apple Silicon 在 macOS Big Sur 上安装 pyaudio 时出错 - Error in installing pyaudio on macOS Big Sur 在 macOS 11.0 Big Sur 上安装 Pyobjc 时出错 - Error installing Pyobjc on macOS 11.0 Big Sur 导入 pyaudio 不起作用 - 找不到符号:Mac 上的 _PaMacCore_SetupChannelMap(Big Sur M1 Apple Silicon) - Import pyaudio doesn't work - Symbol not found: _PaMacCore_SetupChannelMap on mac (Big Sur M1 Apple Silicon) 在 MacOS big sur 上安装 jupyterlab/jupyter notebook 时出错 - Error installing jupyterlab/jupyter notebook on MacOS big sur 在 OSX 11.2.3 Big Sur 上为 python2 安装 sasl 时出错 - Error installing sasl for python2 on OSX 11.2.3 Big Sur 在 MacOS Big Sur 上安装 PyTorch - Installing PyTorch on MacOS Big Sur 安装多个需要不同 LDFLAGS/CPPFLAGS 的 python 包(macOS Big Sur Apple Silicone) - Installing multiple python packages that requires different LDFLAGS/CPPFLAGS (macOS Big Sur Apple Silicone) 带有运行 macOS Big Sur 的 Apple M1 芯片的 iMac 上的 miniconda 安装问题 - miniconda installation issue on iMac with Apple M1 chip running macOS Big Sur
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM