Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Apple Silicon上运行的Big Sur上安装加密时出错_Python_Python 3.x_Openssl - Fatal编程技术网

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

Python 在Apple Silicon上运行的Big Sur上安装加密时出错,python,python-3.x,openssl,Python,Python 3.x,Openssl,我试着在我的全新Air M1上安装加密技术。但是出了点问题。 我已经尝试过谷歌的一些解决方案,但没有效果 环境详情: Python 3.9.1 pip 21.0.1 macOS BigSur 11.2应用程序1 M1 cffi==1.14.5 openssl@1.1 复制步骤: pip3安装加密技术 回溯: copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.macosx-11-arm64

我试着在我的全新Air M1上安装加密技术。但是出了点问题。 我已经尝试过谷歌的一些解决方案,但没有效果

环境详情:

  • Python 3.9.1
  • pip 21.0.1
  • macOS BigSur 11.2应用程序1 M1
  • cffi==1.14.5
  • openssl@1.1
复制步骤:

pip3安装加密技术

回溯:

  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

Rust目前在m1通孔上工作

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

但是,在修复锈迹后,您很可能会遇到另一个错误

导入_cffi_后端作为后端 导入错误:dlopen(/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.x/site-packages//cffi\u backend.cpython-3X-darwin.so,2):未找到合适的图像。确实发现: /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,但架构错误


这里讨论的问题是,CFFI维护人员不支持m1 Mac:

在新的更新之后,它对我有效

sudo xcode-select --install.

我认为最近,python加密模块需要Rust来编译。从长远来看,这将带来巨大的好处,但据报道,过渡过程比可能的更为坎坷……因此我必须等待m1何时支持它?看起来锈现在支持m1,所以应该只是设置它的问题。我不是问这个问题的合适人选,不过……你可以尝试更合适的解决方案:我在萨比克最后一次评论后安装了锈迹,这就解决了问题。谢谢你们!