相关文章推荐
至今单身的杨桃  ·  javascript - ...·  1 年前    · 

针对于Apple M芯片的设备,cffi库需要arm64架构的库,但是维护者认为arm64的库有Bug暂时去掉了支持,所以导致引用无法正常使用。

解决办法:

pip3 install cffi==1.15

把cffi库降级就可以了

突然接到一个项目是关于pyspider,遇到了一些小坑,百度一下发现并没有很好的 解决 所以研究了一下。 我所使用的 python 版本是3.6.8,因为pyspider是对pip有版本要求的,所以自动升级一下。 升级pip •# pip install –upgrade pip 一切配置好之后,就在CMD中运行 pyspider all 来看能否跑起来。 这是成功的样子,说明可以了。 不过路上谁能不遇...
from crtsh import crtsh API import json print ( json . dumps ( crtsh API (). search ( 'uber.com' ))) 结果是一系列字典项,如下所示: " issuer_ca_id " : 16418 , " issuer_name " : " C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 " ,
今天打算弄个爬虫,想来想去打算用 python 弄一个。之前了解到scrapy这个库是个不错的选择,于是开始折腾。可惜第一步就挂了。安装scrapy库就不成功:Installing collected packages: six, w3lib, parsel, pyasn1, pyasn1-modules, attrs, serv ice -identity, scrapy Found existing
python 报错: Runtime Error:fails to pass a sanity check due to a bug in the windows runtime 这种类型的错误 这种错误原因: 1.当前的 python 与numpy版本之间有什么问题,比如我自己用的 python 3.9与numpy1.19.4会导致这种报错。 2.numpy1.19.4与当前很多 python 版本都有问题。 解决 办法: 在File->Settings->Project:pycharmProjects->P
ImportError: dlopen(/Users/red/Library/ Python /3.9/lib/ python /site-packages/_cffi_backend.c python -39-darwin.so, 0x0002): tried: '/Users/red/Library/ Python /3.9/lib/ python /site-packages/_cffi_backend.c python -39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/red/Library/ Python /3.9/lib/ python /site-packages/_cffi_backend.c python -39-darwin.so' (no such file), '/Users/red/Library/ Python /3.9/lib/ python /site-packages/_cffi_backend.c python -39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))thread '<unnamed>' pan icked at ' Python API call failed ', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ pyo3 -0.18.3/src/err/mod.rs:790:5note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceTraceback (most recent call last): File "/usr/local/project/red/ python /memory.py", line 3, in <module> import paramiko File "/Users/red/Library/ Python /3.9/lib/ python /site-packages/paramiko/__init__.py", line 22, in <module> from paramiko.transport import ( File "/Users/red/Library/ Python /3.9/lib/ python /site-packages/paramiko/transport.py", line 33, in <module> from cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes File "/Users/red/Library/ Python /3.9/lib/ python /site-packages/cryptography/hazmat/primitives/ciphers/__init__.py", line 11, in <module> from cryptography.hazmat.primitives.ciphers.base import ( File "/Users/red/Library/ Python /3.9/lib/ python /site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 10, in <module> from cryptography.e xc eption s import ( File "/Users/red/Library/ Python /3.9/lib/ python /site-packages/cryptography/e xc eption s.py", line 9, in <module> from cryptography.hazmat.bindings._rust import e xc eption s as rust_e xc eption s pyo3 _ runtime . Pan icE xc eption : Python API call failed
根据您提供的错误信息,看起来是由于 Python 模块的兼容性问题导致的错误。具体来说,您的 Python 模块 `_cffi_backend` 不兼容当前的处理器架构。 根据错误信息,您的处理器架构是 `arm64`,而需要的架构是 `x86_64`。这可能是由于您的 Python 解释器和相关模块是为不同架构编译的,导致不匹配的问题。 解决 此问题的一种 方法 是确保您使用的 Python 解释器和相关模块都是为您所使用的处理器架构编译的。您可以尝试在兼容的架构上运行该代码,或者尝试使用与您的处理器架构匹配的 Python 解释器和模块。 另外,请确保您的 Python 环境中已经正确安装了所需的模块,并且模块版本与您的代码兼容。您可以使用`pip`命令来安装或更新模块。例如,`pip install paramiko`可以安装`paramiko`模块。 如果问题仍然存在,请尝试检查您的 Python 环境配置,并确保所有依赖项和模块都正确安装和配置。