pyca / cryptography

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.
https://cryptography.io
Other
6.65k stars 1.53k forks source link

Unable to install cryptography python package on ubuntu 16.04 LTS #2909

Closed Battant closed 8 years ago

Battant commented 8 years ago

Here is my configuration

Hello,

My configuration :

Ubuntu 16.04 64 bit apt-cache policy python python: Installed: 2.7.11-1 Candidate: 2.7.11-1 Version table: *\ 2.7.11-1 500 500 http://ch.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 100 /var/lib/dpkg/status

My problem : When I try to install the criptography python packag3e throw pip command, i get this python exception. pip install cryptography

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
  File "/home/mparchet/.local/lib/python2.7/site-packages/pip/__init__.py", line 16, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/home/mparchet/.local/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/home/mparchet/.local/lib/python2.7/site-packages/pip/download.py", line 39, in <module>
    from pip._vendor import requests, six
  File "/home/mparchet/.local/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/home/mparchet/.local/lib/python2.7/site-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 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 68, in <module>
    error=-1)
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 57, in wrapper
    ffi.def_extern(name=name, **kwargs)(func)
AttributeError: 'CompiledFFI' object has no attribute 'def_extern'

Could you help me please to fix this issue ?

Best regards

Battant

alex commented 8 years ago

This is occuring because you're using an older version of cffi than the minimum version required in cryptography's setup.py, I suspect this is the version of cffi from apt-get.