尝试在我的 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 3.9.6) 安装了 python,删除了包并尝试重新安装它们,仍然是同样的错误。
问题 mach-o, but wrong architecture
有一些解决方案,但我找不到针对此特定问题的解决方案。