m0_49938637 2021-08-14 17:04 采纳率: 100%
浏览 61
已结题

在MACOS ARM架构下,安装scrapy失败,提示如下:

在终端输入scrapy后:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/scrapy", line 5, in
from scrapy.cmdline import execute
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/cmdline.py", line 9, in
from scrapy.crawler import CrawlerProcess
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/crawler.py", line 18, in
from scrapy.core.engine import ExecutionEngine
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/core/engine.py", line 14, in
from scrapy.core.scraper import Scraper
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/core/scraper.py", line 16, in
from scrapy.utils.log import failure_to_exc_info, logformatter_adapter
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/utils/log.py", line 12, in
from scrapy.utils.versions import scrapy_components_versions
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/utils/versions.py", line 12, in
from scrapy.utils.ssl import get_openssl_version
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scrapy/utils/ssl.py", line 1, in
import OpenSSL
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/OpenSSL/init.py", line 8, in
from OpenSSL import crypto, SSL
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/OpenSSL/crypto.py", line 17, in
from OpenSSL._util import (
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/OpenSSL/_util.py", line 6, in
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: mach-o, but wrong architecture
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: mach-o, but wrong architecture

如何解决?

  • 写回答

1条回答 默认 最新

  • m0_49938637 2021-08-15 00:18
    关注

    自己解决了

    pip uninstall lxml
    pip3 install lxml

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月23日
  • 已采纳回答 8月15日
  • 创建了问题 8月14日