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

在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日

悬赏问题

  • ¥20 Html备忘录页面制作
  • ¥15 黄永刚的晶体塑性子程序中输入的材料参数里的晶体取向参数是什么形式的?
  • ¥20 数学建模来解决我这个问题
  • ¥15 计算机网络ip分片偏移量计算头部是-20还是-40呀
  • ¥15 stc15f2k60s2单片机关于流水灯,时钟,定时器,矩阵键盘等方面的综合问题
  • ¥15 YOLOv8已有一个初步的检测模型,想利用这个模型对新的图片进行自动标注,生成labellmg可以识别的数据,再手动修改。如何操作?
  • ¥30 NIRfast软件使用指导
  • ¥20 matlab仿真问题,求功率谱密度
  • ¥15 求micropython modbus-RTU 从机的代码或库?
  • ¥15 django5安装失败