首页 > Mac OS下,Scrapy无法正常使用

Mac OS下,Scrapy无法正常使用

在scrapy.cfg文件同级目录运行$ scrapy crawl mylouspider,提示以下错误

2015-12-11 09:25:15 [scrapy] INFO: Scrapy 1.0.3 started (bot: Googlebot)
2015-12-11 09:25:15 [scrapy] INFO: Optional features available: ssl, http11
2015-12-11 09:25:15 [scrapy] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'louspider.spiders', 'SPIDER_MODULES': ['louspider.spiders'], 'USER_AGENT': 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', 'DOWNLOAD_DELAY': 0.5, 'BOT_NAME': 'Googlebot'}
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scrapy", line 11, in <module>
    sys.exit(execute())
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 143, in execute
    _run_print_help(parser, _run_command, cmd, args, opts)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 89, in _run_print_help
    func(*a, **kw)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 150, in _run_command
    cmd.run(args, opts)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/commands/crawl.py", line 57, in run
    self.crawler_process.crawl(spname, **opts.spargs)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 150, in crawl
    crawler = self._create_crawler(crawler_or_spidercls)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 166, in _create_crawler
    return Crawler(spidercls, self.settings)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 46, in __init__
    self.extensions = ExtensionManager.from_crawler(self)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/middleware.py", line 56, in from_crawler
    return cls.from_settings(crawler.settings, crawler)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/middleware.py", line 32, in from_settings
    mwcls = load_object(clspath)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/utils/misc.py", line 44, in load_object
    mod = import_module(module)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/extensions/memusage.py", line 16, in <module>
    from scrapy.mail import MailSender
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/mail.py", line 22, in <module>
    from twisted.internet import defer, reactor, ssl
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/twisted/internet/ssl.py", line 59, in <module>
    from OpenSSL import SSL
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dynamic module does not define init function (init_openssl)

scrapy安装正常,scrapy version显示正常,感谢大家的帮助!


dynamic module does not define init function

没有初始化函数。

【热门文章】
【热门文章】