ModuleNotFoundError: No module named 'scrapy'
# -*- coding:utf-8 -*- from scrapy.cmdline import execute import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) execute(['scrapy', 'crawl', 'baidu'])
pycharm debug调试时报错:
Traceback (most recent call last): File "E:/www/python/scrapy/demo/main.py", line 2, in <module> from scrapy.cmdline import execute ModuleNotFoundError: No module named 'scrapy'
解决方案:
下载 anaconda 并且安装
https://www.anaconda.com/distribution/
打开 anaconda
demo 是项目的名称
说明就可以了
原因分析 : 使用pycharm调用python的时候 没找到scrapy 但是通过pip 去安装 scrapy 不能安装成功 只能通过anaconda去安装scrapy