升级pip&之后的点差错误通过“pip install --upgrade”进行scrapy

时间:2016-10-05 19:31:24

标签: python scrapy pip

使用debian 8(jessie)amd64和python 2.7.9。我尝试了以下命令:

pip install --upgrade pip

pip install --upgrade scrapy

之后,我得到了跟随点差错误

root@debian:~# pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 567, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2604, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2264, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2270, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar  # noqa
File "/usr/local/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 39, in <module>
from pip._vendor import requests, six
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 54, in <module>
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 4, in <module>
binding = Binding()
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 89, in __init__
self._ensure_ffi_initialized()
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 113, in _ensure_ffi_initialized
libraries=libraries,
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/utils.py", line 80, in build_ffi
extra_link_args=extra_link_args,
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 437, in verify
lib = self.verifier.load_library()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 114, in load_library
return self._load_library()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 225, in _load_library
return self._vengine.load_library()
File "/usr/local/lib/python2.7/dist-packages/cffi/vengine_cpy.py", line 174, in load_library
lst = list(map(self.ffi._get_cached_btype, lst))
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 409, in _get_cached_btype
BType = type.get_cached_btype(self, finishlist)
File "/usr/local/lib/python2.7/dist-packages/cffi/model.py", line 61, in get_cached_btype
BType = self.build_backend_type(ffi, finishlist)
File "/usr/local/lib/python2.7/dist-packages/cffi/model.py", line 507, in build_backend_type
base_btype = self.build_baseinttype(ffi, finishlist)
File "/usr/local/lib/python2.7/dist-packages/cffi/model.py", line 525, in build_baseinttype
% self._get_c_name())
cffi.api.CDefError: 'point_conversion_form_t' has no values explicitly defined: refusing to guess which integer type it is meant to be (unsigned/signed, int/long)
用谷歌搜索几个类似的问题,cffi或加密可能会导致这个问题,但我找不到任何明确的方法来修复它。

5 个答案:

答案 0 :(得分:2)

今天得到完全相同的错误,但在不同的情况下。我怀疑这与cryptography模块有关。

帮助我的是安装特定版本的cffi包:

pip install cffi==1.7.0 

答案 1 :(得分:1)

我删除了cffi并尝试使用此命令安装cffi 1.7.0:

RequestID

它有效,谢谢你,alecxe和moeseth:)

答案 2 :(得分:0)

我的情况就像是@alecxe

这有效:

pip install cffi==1.7.0

答案 3 :(得分:0)

moeseth 有同样的问题:当所有pip命令抛出原始异常时,pip install something答案都没用。安装cffi v.1.7.0也解决了这个问题,这就是我在Debian Jessie中设法做到这一点而不依赖于pip:

  1. 暂时将测试回购添加到/etc/apt/sources.list,例如,

    deb http://ftp.fi.debian.org/debian/ testing main contrib non-free
    deb-src http://ftp.fi.debian.org/debian/ testing main contrib non-free
    
  2. 运行sudo apt-get update

  3. 使用aptitude或apt-get将python-cffipython-cffi-backend升级到v.1.7.0
  4. /etc/apt/sources.list删除步骤1中添加的行并运行sudo apt-get update

答案 4 :(得分:0)

所以我遇到pip失败的情况。我必须删除python-cffi然后从具有正确版本的pip安装它

sudo apt-get remove python-cffi
pip install cffi==1.7.0

像魅力一样。