Search code examples
pythonpiprecords

Error while installing records library via pip for Python


just found this records library (version 0.5.0) for Python (my version is 3.6.0) and tried to install it with

$ pip3 install records

The package loads and finishes but afterwards the installation is quitting with this error:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cgungwv4/tablib/

The rest of the log says:

  Using cached tablib-0.11.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-cgungwv4/tablib/setup.py", line 7, in <module>
        import tablib
      File "/tmp/pip-build-cgungwv4/tablib/tablib/__init__.py", line 3, in <module>
        from tablib.core import (
      File "/tmp/pip-build-cgungwv4/tablib/tablib/core.py", line 15, in <module>
        from tablib import formats
      File "/tmp/pip-build-cgungwv4/tablib/tablib/formats/__init__.py", line 6, in <module>
        from . import _csv as csv
      File "/tmp/pip-build-cgungwv4/tablib/tablib/formats/_csv.py", line 6, in <module>
        from tablib.compat import is_py3, csv, StringIO
      File "/tmp/pip-build-cgungwv4/tablib/tablib/compat.py", line 25, in <module>
        import tablib.packages.xlwt3 as xlwt
      File "/tmp/pip-build-cgungwv4/tablib/tablib/packages/xlwt3/__init__.py", line 5, in <module>
        from .Row import Row
      File "/tmp/pip-build-cgungwv4/tablib/tablib/packages/xlwt3/Row.py", line 7, in <module>
        from . import ExcelFormula
      File "/tmp/pip-build-cgungwv4/tablib/tablib/packages/xlwt3/ExcelFormula.py", line 1, in <module>
        from . import ExcelFormulaParser, ExcelFormulaLexer
      File "/tmp/pip-build-cgungwv4/tablib/tablib/packages/xlwt3/ExcelFormulaLexer.py", line 52, in <module>
        VERBOSE+LOCALE+IGNORECASE)
      File "/usr/local/lib/python3.6/re.py", line 233, in compile
        return _compile(pattern, flags)
      File "/usr/local/lib/python3.6/re.py", line 301, in _compile
        p = sre_compile.compile(pattern, flags)
      File "/usr/local/lib/python3.6/sre_compile.py", line 562, in compile
        p = sre_parse.parse(p, flags)
      File "/usr/local/lib/python3.6/sre_parse.py", line 866, in parse
        p.pattern.flags = fix_flags(str, p.pattern.flags)
      File "/usr/local/lib/python3.6/sre_parse.py", line 833, in fix_flags
        raise ValueError("cannot use LOCALE flag with a str pattern")
    ValueError: cannot use LOCALE flag with a str pattern

Does anyone have an idea on how to fix this? Thanks upfront :)


Solution

  • See the issue in tablib: https://github.com/kennethreitz/tablib/issues/267

    Your options:

    1) wait until they fix the pip version

    2) install it yourself from the master branch which seems to have been fixed