Я пытаюсь сделать свой первый бит соскабливания с помощью Scrapy, используя действительно простую демонстрацию от https://github.com/scrapy/dirbot, и я получаю библиотеку ImportError: Library, которая не загружена, как показано ниже.Ошибка Scrapy - ImportError: библиотека не загружена
gchrist1$ scrapy crawl dmoz
2015-12-20 17:48:33 [scrapy] INFO: Scrapy 1.0.3 started (bot: scrapybot)
2015-12-20 17:48:33 [scrapy] INFO: Optional features available: ssl, http11, boto
2015-12-20 17:48:33 [scrapy] INFO: Overridden settings: {'DEFAULT_ITEM_CLASS': 'dirbot.items.Website', 'NEWSPIDER_MODULE': 'dirbot.spiders', 'SPIDER_MODULES': ['dirbot.spiders']}
Traceback (most recent call last):
File "/Users/gchrist1/anaconda/bin/scrapy", line 11, in <module>
sys.exit(execute())
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/cmdline.py", line 143, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/cmdline.py", line 89, in _run_print_help
func(*a, **kw)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/cmdline.py", line 150, in _run_command
cmd.run(args, opts)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/commands/crawl.py", line 57, in run
self.crawler_process.crawl(spname, **opts.spargs)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/crawler.py", line 150, in crawl
crawler = self._create_crawler(crawler_or_spidercls)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/crawler.py", line 166, in _create_crawler
return Crawler(spidercls, self.settings)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/crawler.py", line 46, in __init__
self.extensions = ExtensionManager.from_crawler(self)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/middleware.py", line 56, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/middleware.py", line 32, in from_settings
mwcls = load_object(clspath)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/utils/misc.py", line 44, in load_object
mod = import_module(module)
File "/Users/gchrist1/anaconda/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/extensions/memusage.py", line 16, in <module>
from scrapy.mail import MailSender
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/scrapy/mail.py", line 22, in <module>
from twisted.internet import defer, reactor, ssl
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/twisted/internet/ssl.py", line 59, in <module>
from OpenSSL import SSL
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/Users/gchrist1/anaconda/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Users/gchrist1/anaconda/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so, 2): Library not loaded: libcrypto.1.0.0.dylib
Referenced from: /Users/gchrist1/anaconda/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
Reason: image not found
Я использую Mac OS 10.6.8, с Python 2.7.6 | Anaconda 1.9.1 (x86_64) | (по умолчанию, 10 января 2014, 11:23:15) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Я предполагаю, что ошибка связана с тем, что у меня нет OpenSSL, поэтому я попробовал оба варить install openssl и pip install openssl. Бывший, казалось, работали:
Warning: openssl-1.0.2e already installed
но последний не сделал:
pip install OpenSSL
Downloading/unpacking OpenSSL
Could not find any downloads that satisfy the requirement OpenSSL
Cleaning up...
No distributions at all found for OpenSSL
Storing debug log for failure in /Users/gchrist1/.pip/pip.log)
Но я все еще получаю ту же ошибку. Я также пробовал то, что рекомендуется на https://raspberrypi.stackexchange.com/questions/28176/python-and-openssl-error-on-import , но получил те же ошибки.