我在执行 python-scrappy 示例模块时遇到错误
我的堆栈跟踪:
gridlex@gridlex-laptop:~/Documents/tutorial$ scrapy crawl tutorial/dmoz
/usr/lib/python2.6/dist-packages/zope/__init__.py:3: UserWarning: Module twisted was already imported from /usr/lib/python2.6/dist-packages/twisted/__init__.pyc, but /usr/local/ lib/python2.6/dist-packages is being added to sys.path
import pkg_resources
2011-12-29 22:47:04+0530 [scrapy] INFO: Scrapy 0.14.0.2841 started (bot: tutorial)
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 4, in <module>
execute()
File "/usr/local/lib/python2.6/dist-packages/scrapy/cmdline.py", line 132, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/usr/local/lib/python2.6/dist-packages/scrapy/cmdline.py", line 97, in _run_print_help
func(*a, **kw)
File "/usr/local/lib/python2.6/dist-packages/scrapy/cmdline.py", line 139, in _run_command
cmd.run(args, opts)
File "/usr/local/lib/python2.6/dist-packages/scrapy/commands/crawl.py", line 43, in run
spider = self.crawler.spiders.create(spname, **opts.spargs)
File "/usr/local/lib/python2.6/dist-packages/scrapy/command.py", line 34, in crawler
self._crawler.configure()
File "/usr/local/lib/python2.6/dist-packages/scrapy/crawler.py", line 34, in configure
self.extensions = ExtensionManager.from_crawler(self)
File "/usr/local/lib/python2.6/dist-packages/scrapy/middleware.py", line 48, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "/usr/local/lib/python2.6/dist-packages/scrapy/middleware.py", line 29, in from_settings
mwcls = load_object(clspath)
File "/usr/local/lib/python2.6/dist-packages/scrapy/utils/misc.py", line 39, in load_object
raise ImportError, "Error loading object '%s': %s" % (path, e)
ImportError: Error loading object 'scrapy.telnet.TelnetConsole': No module named conch
只是我有示例 o 使用 python-scrappy 模块执行示例抓取
我用这个例子来执行它http://doc.scrapy.org/en/0.14/intro/tutorial.html#intro-tutorial
最佳答案
Debian 或 Ubuntu(9.04 或更早版本)
如果您运行的是 Debian Linux,请以 root 身份运行以下命令:
apt-get install python-twisted python-libxml2 python-pyopenssl python-simplejson
然后:
easy_install -U w3lib
然后按照安装 Scrapy 中的说明进行操作。
关于python - 执行 python-scrappy 模块时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8671071/