thombashi / pytablewriter

pytablewriter is a Python library to write a table in various formats: AsciiDoc / CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV.
https://pytablewriter.rtfd.io/
MIT License
611 stars 43 forks source link

Version 0.30.0 import failure #5

Closed townie closed 4 years ago

townie commented 6 years ago

Some testing infa uses this package! Its really nice, but it appears version 0.30.0 is in a failing state.

Reproduce In new environment pip install pytablewriter==0.30.0

>>> import pytablewriter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/__init__.py", line 17, in <module>
    from ._factory import TableWriterFactory
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/_factory.py", line 14, in <module>
    from ._table_format import FormatAttr, TableFormat
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/_table_format.py", line 48, in <module>
    class TableFormat(enum.Enum):
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/_table_format.py", line 54, in TableFormat
    [CsvTableWriter().format_name], CsvTableWriter,
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/writer/_csv.py", line 32, in __init__
    super(CsvTableWriter, self).__init__()
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/writer/_text_writer.py", line 100, in __init__
    super(TextTableWriter, self).__init__()
  File "/home/keith/.virtualenvs/ispytablewriterbroken/lib/python2.7/site-packages/pytablewriter/writer/_table_writer.py", line 221, in __init__
    self._dp_extractor.type_value_mapping[Typecode.NONE] = ""
AttributeError: 'DataPropertyExtractor' object has no attribute 'type_value_mapping'
townie commented 6 years ago

Upgrading to 0.35.0 fixed the issue. But leaving this here for anyone that may bump into it.

thombashi commented 6 years ago

@townie Thank you for your report. Another possible workaround is to install as follows:

pip install pytablewriter==0.30.0 DataProperty==0.33.1

However, I would recommend installing the latest version of pytablewriter.

thombashi commented 4 years ago

I'll close the issue. More than a year has passed since created the issue.

arcsector commented 1 year ago

I actually had to upgrade to 0.40.0 to have it finally download all the packages in DataProperty needed. Painful.