繁体   English   中英

在用于Python3.6的virtualenv上没有名为'_sqlite3'的模块

[英]No module named '_sqlite3' on virtualenv for Python3.6

我试图在https://doc.scrapy.org/en/1.3/intro/tutorial.html上运行示例,当我使用scrapy抓取引号运行蜘蛛时,我收到错误:

ModuleNotFoundError:没有名为'_sqlite3'的模块

我正在使用python 3.6运行virtualenv,我如何修复错误来运行我的脚本? 谢谢

UPDATE

该脚本是:

import scrapy


class QuotesSpider(scrapy.Spider):
name = "quotes"

def start_requests(self):
    urls = [
        'http://quotes.toscrape.com/page/1/',
        'http://quotes.toscrape.com/page/2/',
    ]
    for url in urls:
        yield scrapy.Request(url=url, callback=self.parse)

def parse(self, response):
    page = response.url.split("/")[-2]
    filename = 'quotes-%s.html' % page
    with open(filename, 'wb') as f:
        f.write(response.body)
    self.log('Saved file %s' % filename)

尝试:

sudo apt-get install libsqlite3-dev

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM