15

I'm installing several python packages via pip install on travis,

language: python
python:
- '2.7'
install:
- pip install -r requirements/env.txt

Everything worked fine, but today I started getting following error:

 Running setup.py install for cryptography
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-hKwMR3/cryptography/setup.py", line 334, in <module>
    **keywords_with_side_effects(sys.argv)
  File "/opt/python/2.7.9/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
    _Distribution.__init__(self,attrs)
  File "/opt/python/2.7.9/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/setuptools/dist.py", line 325, in finalize_options
    ep.load()(self, ep.name, value)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 181, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 48, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 24, in execfile
    exec(code, glob, glob)
  File "src/_cffi_src/build_openssl.py", line 81, in <module>
    extra_link_args=extra_link_args(compiler_type()),
  File "/tmp/pip-build-hKwMR3/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding
    extra_link_args=extra_link_args,
  File "/tmp/pip-build-hKwMR3/cryptography/src/_cffi_src/utils.py", line 70, in build_ffi
    ffi.cdef(cdef_source)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/api.py", line 105, in cdef
    self._cdef(csource, override=override, packed=packed)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/api.py", line 119, in _cdef
    self._parser.parse(csource, override=override, **options)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/cparser.py", line 299, in parse
    self._internal_parse(csource)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/cparser.py", line 304, in _internal_parse
    ast, macros, csource = self._parse(csource)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/cparser.py", line 260, in _parse
    ast = _get_parser().parse(csource)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/cffi/cparser.py", line 40, in _get_parser
    _parser_cache = pycparser.CParser()
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pycparser/c_parser.py", line 87, in __init__
    outputdir=taboutputdir)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pycparser/c_lexer.py", line 66, in build
    self.lexer = lex.lex(object=self, **kwargs)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pycparser/ply/lex.py", line 911, in lex
    lexobj.readtab(lextab, ldict)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pycparser/ply/lex.py", line 233, in readtab
    titem.append((re.compile(pat, lextab._lexreflags | re.VERBOSE), _names_to_funcs(func_name, fdict)))
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/re.py", line 194, in compile
    return _compile(pattern, flags)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/re.py", line 249, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/sre_compile.py", line 583, in compile
    "sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups

Solutions?

glmvrml
  • 1,612
  • 2
  • 14
  • 31
  • Some package which depends on cryptography, obviously. Don't think that my file with 100 lines will help! Answering your question - YES – glmvrml Oct 03 '16 at 10:32
  • Looks like new version of [`cryptography`](https://pypi.python.org/pypi/cryptography) came out a week ago, you might want to report a bug with them? For now pin to an older version and see if problem goes away. – metatoaster Oct 03 '16 at 10:38
  • Oh, heh, someone beat you to it https://github.com/pyca/cryptography/issues/3187 – metatoaster Oct 03 '16 at 10:38
  • There's no reason to -1 this question ... – Stepan Vavra Oct 03 '16 at 11:24
  • I'm getting this error when trying to install an older version. pip install cryptography==0.3. The latest version works – Rusty1 Oct 03 '16 at 13:25

1 Answers1

25

There is a bug with PyCParser - See https://github.com/pyca/cryptography/issues/3187

The work around is to use another version or to not use the binary distribution.

pip install git+https://github.com/eliben/pycparser@release_v2.14

or

pip install --no-binary pycparser
Tom
  • 15,798
  • 4
  • 37
  • 48
  • `pip install git+https://github.com/eliben/pycparser@release_v2.14` this did it. Seems like pip on travis is outdated so I was not able to use `--no-binary` – glmvrml Oct 03 '16 at 11:23
  • For the --no-binary option to work you need to be on the latest pip. Try upgrading you pip version. – Rusty1 Oct 03 '16 at 13:26
  • As mentioned in the issue it might be clever to skip release 2.14 and use 2.13 `pip install pycparser==2.13` – Sylvain Oct 03 '16 at 15:00
  • added `git+https://github.com/eliben/pycparser@release_v2.14` to my `requirements.txt` and tried to run `pip install` with and without it. In first case it downloads normal package and it works OK, but in second case it takes `pycparser-2.14-py2.py3-none-any.whl` package and everything is failing. So, nice workaround! – Max L Oct 03 '16 at 15:10
  • Running with `--no-binary pycparser` didn't help our Jenkins processes get passed the error described above. I went ahead and included `pycparser==2.14` in our `requirements.txt` for the time being and that seems to have solved the problem for now. – steve-gregory Oct 18 '16 at 15:41
  • 4
    Update: pycparser 2.16 has been released and resolves this issue. Cf. https://github.com/pyca/cryptography/issues/3187#issuecomment-254582101 – Pierre Oct 19 '16 at 07:55
  • This is why I love the software development, There's just a released for this issue. :D – BlaShadow Oct 19 '16 at 13:35