2016-11-25 101 views
1

安裝scrapy我想安裝scrapy我在ubunu項目。我使用PIP安裝scrapy但安裝時我總是收到此錯誤。得到錯誤,而在Ubuntu

Traceback (most recent call last): 
    File "/usr/bin/pip", line 9, in <module> 
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() 
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 558, in load_entry_point 
    return get_distribution(dist).load_entry_point(group, name) 
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point 
    return ep.load() 
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load 
    return self.resolve() 
    File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, in resolve 
    module = __import__(self.module_name, fromlist=['__name__'], level=0) 
    File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module> 
    from pip.vcs import git, mercurial, subversion, bazaar # noqa 
    File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module> 
    from pip.download import path_to_url 
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 22, in <module> 
    import requests, six 
    File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module> 
    from .packages.urllib3.contrib import pyopenssl 
    File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 53, in <module> 
    import OpenSSL.SSL 
    File "/home/karthick/.local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module> 
    from OpenSSL import rand, crypto, SSL 
    File "/home/karthick/.local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 112, in <module> 
    if _lib.Cryptography_HAS_SSL_ST: 
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST' 

那麼,如何擺脫這種錯誤的安裝scrapy

+1

首先使用'sudo pip install --upgrade pip更新你的點子,然後看看[scrapy documentatin](https://doc.scrapy.org/en/latest/intro/install.html#things - 即,是好方知)然後安裝缺少的依賴關係。你的情況,你有'pyOpenSSL'使用安裝:'須藤PIP安裝pyOpenSSL'然後嘗試重新安裝scrapy。 –

回答

1

我覺得你應該先更新你的點子,然後再試一次。 我看到pip==1.5.6,媽呀,這比月球

+0

:d我不認爲這是一個問題 – pkarthicbz

1

這發生在我大(儘管蟒蛇,不pip)。

我跟蹤到了將pyopenssl從16.0更新到16.2。

我的解決方案是首先重新安裝Anaconda(將pyopenssl恢復爲16.0)。 (您可能不需要這麼做。)

在那之後,我只是跑

sudo apt install python3-openssl 

這樣做了以後,我的問題似乎得到糾正。

+0

我有同樣的'AttributeError'當我想運行一個jupyter筆記本。更新python3-的OpenSSL的建議,jupyter作品後! – Roald