Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cffi fails to install: ImportError: No module named setuptools_ext #268

Closed
tbelliard opened this issue Feb 17, 2016 · 2 comments
Closed

Comments

@tbelliard
Copy link

On Debian 8 (jessie), for some reason, the cryptography dependency 'cffi' fails to install when running setup.sh, returning the following error:

Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-vRodyG/cryptography/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpObNFsBpip-wheel-:

  Installed /tmp/pip-build-vRodyG/cryptography/cffi-1.5.2-py2.7-linux-x86_64.egg
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-vRodyG/cryptography/setup.py", line 318, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 266, in __init__
      _Distribution.__init__(self,attrs)
    File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
      self.finalize_options()
    File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 301, in finalize_options
      ep.load()(self, ep.name, value)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
      ['__name__'])
  ImportError: No module named setuptools_ext

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py bdist_wheel for contextlib2
  Stored in directory: /root/.cache/pip/wheels/69/10/11/32bef7b8857cbd724a51487711793db25d047d96cd7213c17e
  Running setup.py bdist_wheel for MarkupSafe
  Stored in directory: /root/.cache/pip/wheels/94/a7/79/f79a998b64c1281cb99fa9bbd33cfc9b8b5775f438218d17a7
  Running setup.py bdist_wheel for lazy-object-proxy
  Stored in directory: /root/.cache/pip/wheels/d5/a1/c9/c42eabc6c5a6b352393b2cc4c500da7c0253e218556cf1aaee
  Running setup.py bdist_wheel for wrapt
  Stored in directory: /root/.cache/pip/wheels/00/c5/bc/d83286f6a26384eb928e7f1818358f324ad15ac1447df6e267
  Running setup.py bdist_wheel for docutils
  Stored in directory: /root/.cache/pip/wheels/d5/32/4f/1347e8ac67071e8150a5dc69354a51a04ac065d0b48334f608
Successfully built nylas-production-python coverage httplib2 pytest pytest-xdist SQLAlchemy pymongo dnspython boto ipython Flask gevent gevent-socketio gunicorn mysqlclient chardet setproctitle gdata alembic iconv pep8 flake8 pyflakes html2text python-magic greenlet faulthandler pyinstrument simplejson uritemplate icalendar pynacl pyaml enum34 msgpack-python guppy redis hiredis mockredispy lunatic-python-bugfix vobject lxml arrow hypothesis Pympler psutil gevent-openssl backports.ssl itsdangerous gevent-websocket cchardet cython dnsq expiringdict regex Mako aniso8601 PyYAML contextlib2 MarkupSafe lazy-object-proxy wrapt docutils
Failed to build cryptography
Installing collected packages: contextlib2, raven, greenlet, gevent, colorlog, structlog, gunicorn, nylas-production-python, coverage, httplib2, pytest, apipkg, execnet, pytest-xdist, SQLAlchemy, pymongo, dnspython, boto, ipython, Werkzeug, MarkupSafe, Jinja2, itsdangerous, Flask, python-dateutil, freezegun, gevent-websocket, gevent-socketio, mysqlclient, chardet, setproctitle, gdata, cchardet, cython, expiringdict, dnsq, WebOb, redis, regex, flanker, Mako, alembic, iconv, pep8, pyflakes, mccabe, flake8, lazy-object-proxy, wrapt, astroid, pylint, html2text, python-magic, PyMySQL, click, faulthandler, pyinstrument, simplejson, aniso8601, pytz, Flask-RESTful, uritemplate, icalendar, pynacl, PyYAML, pyaml, enum34, msgpack-python, guppy, hiredis, funcsigs, pbr, mock, mockredispy, lunatic-python-bugfix, vobject, lxml, arrow, hypothesis, statsd, jmespath, futures, docutils, botocore, boto3, Pympler, psutil, idna, pyasn1, ipaddress, cryptography, pyopenssl, gevent-openssl, backports.ssl, imapclient
  Running setup.py install for python-dateutil
  Found existing installation: chardet 2.3.0
    Uninstalling chardet-2.3.0:
      Successfully uninstalled chardet-2.3.0
  Running setup.py install for flanker
  Found existing installation: lxml 3.4.0
    Uninstalling lxml-3.4.0:
      Successfully uninstalled lxml-3.4.0
  Found existing installation: pyasn1 0.1.7
    Uninstalling pyasn1-0.1.7:
      Successfully uninstalled pyasn1-0.1.7
  Found existing installation: cryptography 0.6.1
    Can't uninstall 'cryptography'. No files were found to uninstall.
  Running setup.py install for cryptography
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-vRodyG/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7UB0P4-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-vRodyG/cryptography/setup.py", line 318, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 266, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 301, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
        ['__name__'])
    ImportError: No module named setuptools_ext

    ----------------------------------------
  Can't roll back cryptography; was not uninstalled
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-vRodyG/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7UB0P4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vRodyG/cryptography

A bit of googling provided the following workaround : just install cffi manually with pip install --upgrade cffi and then run setup.sh again.

Being unfamiliar with pip I have no idea what is the exact cause of the problem.

@singhkays
Copy link

singhkays commented Apr 25, 2016

@tbelliard Should be fixed in #295

spang pushed a commit that referenced this issue Mar 8, 2017
Currently setup.sh keeps failing for me on a Debian 8 VM. Turns out the
error is similar to here pyca/cryptography#2280, which is due to apt
installed of cffi version being less than 1.1.

Command /usr/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-X8h31p-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1
in /tmp/pip_build_root/cryptography Storing debug log for failure in
/home/nikolai/.pip/pip.log

This PR also fixes #261 #267 #268

setup.sh script now installs libssl-dev #261
added cffi to requirements.txt file which fixes the error in pyca/cryptography#2280 and #268
@spang
Copy link
Contributor

spang commented Mar 8, 2017

Should be fixed in the latest release!

@spang spang closed this as completed Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants