2015-04-05 315 views
2

I「m如果這些錯誤,當我創建一個scrapy項目。我已經通過所有的谷歌鏈接去了,它只是不會工作了,我在Ubuntu 14.04Scrapy在Ubuntu 14.04

Traceback (most recent call last): 
    File "/usr/local/bin/scrapy", line 11, in <module> 
    sys.exit(execute()) 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 122, in execute 
    cmds = _get_commands_dict(settings, inproject) 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 46, in _get_commands_dict 
    cmds = _get_commands_from_module('scrapy.commands', inproject) 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 29, in _get_commands_from_module 
    for cmd in _iter_command_classes(module): 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 20, in _iter_command_classes 
    for module in walk_modules(module_name): 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 68, in walk_modules 
    submod = import_module(fullpath) 
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/bench.py", line 3, in <module> 
    from scrapy.tests.mockserver import MockServer 
    File "/usr/local/lib/python2.7/dist-packages/scrapy/tests/mockserver.py", line 6, in <module> 
    from twisted.internet import reactor, defer, ssl 
    File "/usr/local/lib/python2.7/dist-packages/twisted/internet/ssl.py", line 59, in <module> 
    from OpenSSL import SSL 
    File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module> 
    from OpenSSL import rand, crypto, SSL 
    File "/usr/local/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module> 
    from OpenSSL._util import (
    File "/usr/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 3, in <module> 
    from cryptography.hazmat.bindings.openssl.binding import Binding 
ImportError: No module named cryptography.hazmat.bindings.openssl.binding 

有人說做PIP安裝pyOpenSSL == 0.13我得到以下

OpenSSL/crypto/x509.h:17:25: fatal error: openssl/ssl.h: No such file or directory 

#include <openssl/ssl.h> 

         ^

compilation terminated. 

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

回答

3

您需要安裝libssl-dev包:

sudo apt-get install libssl-dev