Scrapy教程:Sublime编辑器中的“没有命名模块”

时间:2012-12-09 14:59:45

标签: scrapy

情况:我正在从头开始学习网络抓取。我在做Scrapy tutorial

问题:没有名为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]

先谢谢我,我是初学者。

1 个答案:

答案 0 :(得分:0)

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

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

例如:

{
    "path": "/usr/bin/",
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}