Open ShaoqingH opened 4 years ago
感谢反馈。
出错是因为直接运行的py文件,应该在eibo-search文件夹下运行
scrapy crawl search -s JOBDIR=crawls/search
如果还有问题欢迎继续讨论。
客气了。
你上面说“我这样试了一下,不知道操作上是否有问题?但提示了下面的错误:”,但是下面是空行,没有错误,不知道是又出现了错误还是指上面的错误?现在能正确运行了吗?
刚才插入的图片,可能没看到,我复制了一下在终端的提示,不知道是否方便您查看(附件里我加上了截图): (base) hanshaoqingdeMacBook-Pro:weibo-search-master hanshaoqing$ scrapy crawl search -s JOBDIR=crawls/search Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/scrapy", line 8, in <module> sys.exit(execute()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/cmdline.py", line 112, in execute settings = get_project_settings() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/project.py", line 69, in get_project_settings settings.setmodule(settings_module_path, priority='project') File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/settings/init.py", line 287, in setmodule module = import_module(module) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 962, in _find_and_load_unlocked ModuleNotFoundError: No module named 'weibo.settings'; 'weibo' is not a package (base) hanshaoqingdeMacBook-Pro:weibo-search-master hanshaoqing$ scrapy crawl search Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/scrapy", line 8, in <module> sys.exit(execute()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/cmdline.py", line 112, in execute settings = get_project_settings() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/project.py", line 69, in get_project_settings settings.setmodule(settings_module_path, priority='project') File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/settings/init.py", line 287, in setmodule module = import_module(module) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 962, in _find_and_load_unlocked ModuleNotFoundError: No module named 'weibo.settings'; 'weibo' is not a package
------------------ 原始邮件 ------------------ 发件人: "Chen Lei"<notifications@github.com>; 发送时间: 2020年6月20日(星期六) 下午5:34 收件人: "dataabc/weibo-search"<weibo-search@noreply.github.com>; 抄送: "1197818137"<1197818137@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [dataabc/weibo-search] 关于 No module named 'weibo.utils' 问题 (#18)
客气了。
你上面说“我这样试了一下,不知道操作上是否有问题?但提示了下面的错误:”,但是下面是空行,没有错误,不知道是又出现了错误还是指上面的错误?现在能正确运行了吗?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我怀疑是scrapy版本问题,可以参考#2,貌似是同一个问题,按照最后帖子的方法应该可以解决。
大神你好,感谢您的代码,有个问题不知道怎么解决,恳请您帮助。 我用sublime运行search的时候,出现了下面的错误: Traceback (most recent call last): File "/Users/hanshaoqing/Downloads/weibo-search-master/weibo/spiders/search.py", line 10, in
import weibo.utils.util as util
ModuleNotFoundError: No module named 'weibo.utils'; 'weibo' is not a package
[Finished in 0.6s with exit code 1]
[cmd: ['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3', '-u', '/Users/hanshaoqing/Downloads/weibo-search-master/weibo/spiders/search.py']]
[dir: /Users/hanshaoqing/Downloads/weibo-search-master/weibo/spiders]
[path: /Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/anaconda3/bin:/Users/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
这个是什么原因啊?怎么解决?