无法在Apple M1芯片上使用Scrapy

sbdsn5lh  于 2022-11-09  发布在  其他
关注(0)|答案(1)|浏览(215)

我有一个基本的代码,旨在废弃'quotes.com'和检索两个页面的标题,使用scrapy库:

import scrapy

class Crawler(scrapy.Spider):
    name = "quotes"
    start_urls = [
        "https://quotes.toscrape.com/page/1/",
        "https://quotes.toscrape.com/page/2/",
    ]

    def parse(self, response):
        print(response.css("title::text").get())

在我的苹果MacbookPro(m1 pro芯片)上,它给了我一个'MemoryError':

MemoryError: Cannot allocate write+execute memory for ffi.callback(). 
You might be running on a system that prevents this.
For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

我该怎么做才能让它发挥作用呢?

zfycwa2u

zfycwa2u1#

使用Python 3.10环境对我来说很有用。

相关问题