python - Mac OS下,Scrapy无法正常使用

 ZQ我是疯癫小karmenRJ 发布于 2022-10-31 23:00

在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 
    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 
    from scrapy.mail import MailSender
  File "/Users/marshall/Library/Python/2.7/lib/python/site-packages/scrapy/mail.py", line 22, in 
    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 
    from OpenSSL import SSL
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in 
    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 
    from OpenSSL._util import (
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in 
    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 
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dynamic module does not define init function (init_openssl)

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

1 个回答
  • dynamic module does not define init function

    没有初始化函数。

    2022-10-31 23:08 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有