修复 macOS 上安装 adb 的问题

问题描述 投票:0回答:1
PCs-MacBook-Pro:platform-tools pc$ pip3 install adbCollecting adbUsing cached adb-1.3.0-py3-none-any.whlCollecting libusb1>=1.0.16 (from adb)Using cached libusb1-3.1.0-py3-none-any.whl.metadata (15 kB)Collecting M2Crypto<=0.26.4,>=0.21.1 (from adb)Using cached M2Crypto-0.26.4.tar.gz (1.1 MB)Preparing metadata (setup.py) ... doneCollecting typing (from M2Crypto<=0.26.4,>=0.21.1->adb)Using cached typing-3.7.4.3-py3-none-any.whlUsing cached libusb1-3.1.0-py3-none-any.whl (62 kB)Building wheels for collected packages: M2CryptoBuilding wheel for M2Crypto (setup.py) ... errorerror: subprocess-exited-with-error`

python setup.py bdist_wheel did not run successfully.│ exit code: 1╰─> [64 lines of output]/private/var/folders/lc/bwzcyvpn1g536zm7hdqkn54c0000gn/T/pip-install-nv2bsszf/m2crypto_a4ddd2e7143345639f062f6b558d9762/setup.py:72: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.return StrictVersion(ver_str) >= StrictVersion(req_ver)/private/var/folders/lc/bwzcyvpn1g536zm7hdqkn54c0000gn/T/pip-install-nv2bsszf/m2crypto_a4ddd2e7143345639f062f6b558d9762/setup.py:233: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.return StrictVersion(ver_str) >= StrictVersion(req_ver)running bdist_wheelrunning buildrunning build_pycopying M2Crypto/callback.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/EVP.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/AuthCookie.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/m2.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/ftpslib.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/EC.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/httpslib.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/X509.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/util.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/RSA.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/BIO.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/DH.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/init.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/threading.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/Rand.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/SMIME.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/Engine.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/m2xmlrpclib.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/RC4.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/m2urllib2.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/DSA.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/six.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/m2urllib.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/BN.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/m2crypto.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/Err.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocopying M2Crypto/ASN1.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Cryptocreating build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/cb.py -> build/lib.macosx-10.9-universal2-cpyyour textthon-312/M2Crypto/SSLcopying M2Crypto/SSL/Session.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/timeout.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/init.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/Cipher.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/Connection.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/Context.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/SSLServer.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcopying M2Crypto/SSL/Checker.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/SSLcreating build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/PublicKeyRing.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/RSA.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/constants.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/init.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/packet.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPcopying M2Crypto/PGP/PublicKey.py -> build/lib.macosx-10.9-universal2-cpython-312/M2Crypto/PGPrunning build_extbuilding 'M2Crypto._m2crypto' extensionswigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.cswig -python -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -I/usr/include -includeall -modern -builtin -outdir /private/var/folders/lc/bwzcyvpn1g536zm7hdqkn54c0000gn/T/pip-install-nv2bsszf/m2crypto_a4ddd2e7143345639f062f6b558d9762/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.iDeprecated command line option: -modern. Ignored, this option is now always on.SWIG/_m2crypto.i:43: Error: Unable to find 'openssl/opensslv.h'SWIG/_m2crypto.i:60: Error: Unable to find 'openssl/safestack.h'SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'SWIG/_rc4.i:5: Error: Unable to find 'openssl/opensslconf.h'SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'error: command '/usr/local/bin/swig' failed with exit code 1[end of output]`
note: This error originates from a subprocess, and is likely not a problem with pip.ERROR: Failed building wheel for M2CryptoRunning setup.py clean for M2CryptoFailed to build M2CryptoERROR: Could not build wheels for M2Crypto, which is required to install pyproject.toml-based projects

我已经安装了 Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
我还安装了
brew
(Homebrew 4.3.6)、
swig
(SWIG 版本 4.2.1)和
m2crypto
(名称:M2加密 版本:0.41.0 摘要:Python 加密和 SSL 工具包 主页:https://gitlab.com/m2crypto/m2crypto 作者:黄鹏祥 作者电子邮件:[电子邮件受保护] 许可证:麻省理工学院 位置:/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages) 和“openSSL”(OpenSSL 3.0.13 2024 年 1 月 30 日) 但是当我尝试安装 adb 时,他给了我这个错误。

python bash adb
1个回答
0
投票

我创建了虚拟环境,并使用brew安装了pipx,并在这个虚拟环境中安装了adb。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.