简体   繁体   中英

Scrapy module not found for a web crawling script

I have scrapy version 1.4 and python 3. I am trying to use scrapy with python, however, whenever I run python3 script.py , I get a return error

File "script.py", line 2, in <module>
    from scrapy import Spider
ModuleNotFoundError: No module named 'scrapy'

However, the imports are below

from __future__ import absolute_import
from scrapy import Spider
from scrapy.selector import Selector
from stack.items import StackItem

class StackSpider(Spider):

When I run pip show scrapy

Name: Scrapy
Version: 1.4.0
Summary: A high-level Web Crawling and Web Scraping framework
...

如果要在python3中进行编码, pip3 install scrapy通过pip3 install scrapy install scrapy为python3 pip3 install scrapy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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