macOS Big Sur:_cffi_backend.cpython39darwin.so:有男子气概,但架构错误

2024-10-06 12:45:29 发布

您现在位置:Python中文网/ 问答频道 /正文

当尝试在我的mac(Big Sur 11.3.1)上使用pip3 install -r pycares安装pycares时,我遇到以下错误:

Collecting pycares
  Using cached pycares-4.0.0.tar.gz (819 kB)
    ERROR: Command errored out with exit status 1:
     command: /opt/homebrew/opt/python@3.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/setup.py'"'"'; __file__='"'"'/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-pip-egg-info-1ig5h0aa
         cwd: /private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/
    Complete output (29 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/setup.py", line 16, in <module>
        setup(name             = 'pycares',
      File "/opt/homebrew/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py", line 455, in __init__
        _Distribution.__init__(self, {
      File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py", line 801, in finalize_options
        ep(self)
      File "/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py", line 808, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "src/_cffi_src/build_cares.py", line 603, in <module>
        ffi = cffi.FFI()
      File "/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/cffi/api.py", line 48, in __init__
        import _cffi_backend as backend
    ImportError: dlopen(/private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/_cffi_backend.cpython-39-darwin.so, 2): no suitable image found.  Did find:
        /private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/_cffi_backend.cpython-39-darwin.so: mach-o, but wrong architecture
        /private/var/folders/jv/yxdbb6tn6n5gc9w719g8rt48000170/T/pip-install-59emzx2m/pycares_c75c0122a38f404d9813047a7451425b/.eggs/cffi-1.14.6-py3.9-macosx-11-arm64.egg/_cffi_backend.cpython-39-darwin.so: mach-o, but wrong architecture
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/25/5a/ed8cc3340b7e83a5e572b5d27387a968a7e52b1e3c269442076ca902b7ba/pycares-4.0.0.tar.gz#sha256=d0154fc5753b088758fbec9bc137e1b24bb84fc0c6a09725c8bac25a342311cd (from https://pypi.org/simple/pycares/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我用brew安装了python(Python3.9.6),删除了软件包并尝试重新安装,仍然是相同的错误。 对于这个问题mach-o, but wrong architecture,有一些解决方案可用,但我找不到这个特定问题的解决方案


Tags: installpipinpyvarsetuplineprivate