0

情况:我正在从头开始学习网络爬虫。我正在做Scrapy 教程

问题:没有名为 scrapy.item 的模块

Traceback (most recent call last):
  File "/Users/Thomas/Desktop/test sublime.py", line 4, in <module>
    from scrapy.item import Item, Field
ImportError: No module named scrapy.item
[Finished in 0.4s with exit code 1]

在此先感谢我是初学者。

4

1 回答 1

0

如果你输入,会显示什么路径which scrapy?在命令行?

尝试将该路径添加到 Python.sublime-build 文件(转到 Preferences->Browse Packages->Python->Python.sublime-build)

例如:

{
    "path": "/usr/bin/",
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}
于 2012-12-10T15:18:09.143 回答