2017-02-26 189 views
0

我試圖在我的mac(10.12.3)上安裝scrapy,但失敗。實際上,我可以在pycharm中導入scrapy,但是沒有錯誤,但是當我嘗試在我的終端中使用時,發生錯誤。無法在我的mac上安裝scrapy

loohazeMacBook-Pro:~ loohaze$ scrapy 
Traceback (most recent call last): 
    File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scrapy", line 11, in <module> 
    load_entry_point('Scrapy==1.3.2', 'console_scripts', 'scrapy')() 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 121, in execute 
    cmds = _get_commands_dict(settings, inproject) 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 45, in _get_commands_dict 
    cmds = _get_commands_from_module('scrapy.commands', inproject) 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 28, in _get_commands_from_module 
    for cmd in _iter_command_classes(module): 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/cmdline.py", line 19, in _iter_command_classes 
    for module in walk_modules(module_name): 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/utils/misc.py", line 71, in walk_modules 
    submod = import_module(fullpath) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
    File "/Users/loohaze/Library/Python/2.7/lib/python/site-packages/scrapy/commands/version.py", line 6, in <module> 
    import OpenSSL 
    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 12, 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 14, in <module> 
    from cryptography.hazmat.bindings._openssl import ffi, lib 

ImportError: dynamic module does not define init function (init_openssl) 

我是新來的蟒蛇,請幫忙!感謝

回答