Cryptography: CentOS 7 Install Error

Created on 6 Jul 2016  路  5Comments  路  Source: pyca/cryptography

Not sure if this is the right spot, but I have been having this issue and can't seem to google my way out of it. I can't get cryptography to install. keep coming up with this. Anyone seen this?

[root@vm10 cryptography]# pip install cryptography
Collecting cryptography
  Using cached cryptography-1.4.tar.gz
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.8 in /usr/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in /usr/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /usr/lib/python2.7/site-packages/setuptools-24.0.2-py2.7.egg (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): cffi>=1.4.1 in /usr/lib64/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography)
Building wheels for collected packages: cryptography
  Running setup.py bdist_wheel for cryptography ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ljHPUu/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpFau2Dhpip-wheel- --python-tag cp27:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ljHPUu/cryptography/setup.py", line 333, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
      _setup_distribution = dist = klass(attrs)
    File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in __init__
    File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
      self.finalize_options()
    File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 327, in finalize_options
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 161, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 48, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 24, in execfile
      exec(code, glob, glob)
    File "src/_cffi_src/build_openssl.py", line 93, in <module>
      extra_link_args=extra_link_args(compiler_type()),
    File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 64, in build_ffi_for_binding
      extra_link_args=extra_link_args,
    File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 73, in build_ffi
      ffi.cdef(cdef_source)
    File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 103, in cdef
      self._parser.parse(csource, override=override, packed=packed)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 166, in parse
      self._internal_parse(csource)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 200, in _internal_parse
      realtype = self._get_type(decl.type, name=decl.name)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 349, in _get_type
      return resolve_common_type(ident)
    File "/usr/lib64/python2.7/site-packages/cffi/commontypes.py", line 35, in resolve_common_type
      "if you think it should be." % (commontype,))
  cffi.api.FFIError: Unsupported type: 'int __dotdotdot__'.  Please file a bug if you think it should be.

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ljHPUu/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ljHPUu/cryptography/setup.py", line 333, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
      _setup_distribution = dist = klass(attrs)
    File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in __init__
    File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
      self.finalize_options()
    File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 327, in finalize_options
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 161, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 48, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 24, in execfile
      exec(code, glob, glob)
    File "src/_cffi_src/build_openssl.py", line 93, in <module>
      extra_link_args=extra_link_args(compiler_type()),
    File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 64, in build_ffi_for_binding
      extra_link_args=extra_link_args,
    File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 73, in build_ffi
      ffi.cdef(cdef_source)
    File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 103, in cdef
      self._parser.parse(csource, override=override, packed=packed)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 166, in parse
      self._internal_parse(csource)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 200, in _internal_parse
      realtype = self._get_type(decl.type, name=decl.name)
    File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 349, in _get_type
      return resolve_common_type(ident)
    File "/usr/lib64/python2.7/site-packages/cffi/commontypes.py", line 35, in resolve_common_type
      "if you think it should be." % (commontype,))
  cffi.api.FFIError: Unsupported type: 'int __dotdotdot__'.  Please file a bug if you think it should be.

  ----------------------------------------
  Failed cleaning build dir for cryptography
Failed to build cryptography
Installing collected packages: cryptography
  Running setup.py install for cryptography ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ljHPUu/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-SEpUm4-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ljHPUu/cryptography/setup.py", line 333, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in __init__
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 327, in finalize_options
      File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 161, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 48, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 24, in execfile
        exec(code, glob, glob)
      File "src/_cffi_src/build_openssl.py", line 93, in <module>
        extra_link_args=extra_link_args(compiler_type()),
      File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 64, in build_ffi_for_binding
        extra_link_args=extra_link_args,
      File "/tmp/pip-build-ljHPUu/cryptography/src/_cffi_src/utils.py", line 73, in build_ffi
        ffi.cdef(cdef_source)
      File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 103, in cdef
        self._parser.parse(csource, override=override, packed=packed)
      File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 166, in parse
        self._internal_parse(csource)
      File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 200, in _internal_parse
        realtype = self._get_type(decl.type, name=decl.name)
      File "/usr/lib64/python2.7/site-packages/cffi/cparser.py", line 349, in _get_type
        return resolve_common_type(ident)
      File "/usr/lib64/python2.7/site-packages/cffi/commontypes.py", line 35, in resolve_common_type
        "if you think it should be." % (commontype,))
    cffi.api.FFIError: Unsupported type: 'int __dotdotdot__'.  Please file a bug if you think it should be.

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ljHPUu/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-SEpUm4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ljHPUu/cryptography/
[root@vm10 cryptography]#

Most helpful comment

cffi was janked. uninstall it and re-installed it. thanks for pointing that out Alex!

All 5 comments

Do you already have cffi installed; if yes what version?

Ding!
Proceed (y/n)? y
Successfully uninstalled cffi-1.7.0
[root@vm10 cryptography]#
[root@vm10 cryptography]#
[root@vm10 cryptography]# pip install cffi
Requirement already satisfied (use --upgrade to upgrade): cffi in /usr/lib64/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/lib/python2.7/site-packages (from cffi)
[root@vm10 cryptography]# pip install cffi --upgrade
Collecting cffi
Using cached cffi-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already up-to-date: pycparser in /usr/lib/python2.7/site-packages (from cffi)
Installing collected packages: cffi
Found existing installation: cffi 0.8.6
Uninstalling cffi-0.8.6:
Successfully uninstalled cffi-0.8.6
Successfully installed cffi-1.7.0

~
Successfully installed cryptography-1.4 paramiko-2.0.1
[root@vm10 cryptography]#

cffi was janked. uninstall it and re-installed it. thanks for pointing that out Alex!

馃憤 sounds good

I got the same error with current version of CentOS. My impression is that the version that comes with CentOS is broken in such way that prevents pip from uninstalling it.

The workaround would be to remove it using yum remove -y python-cffi before trying to install it using pip. If you install the new version using pip, you may end-up with two versions.

I ended up with a very ugly logic for repairing this:

yum remove -y python-cffi
pip install cffi>=1.8.0
python -c "import cffi; print(cffi.__version__)"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

manjunathb4461 picture manjunathb4461  路  7Comments

NikolaiT picture NikolaiT  路  4Comments

darkn3rd picture darkn3rd  路  6Comments

webknjaz picture webknjaz  路  7Comments

ianloic picture ianloic  路  8Comments