wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.

Home Page:https://csvkit.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error with python 3.11

fgvieira opened this issue · comments

I am using csvkit through conda to reorder some columns in a TSV file:

csvcut -t -c 12,1-10 input.tsv | csvformat -T > output.tsv

and it all works well with python <=3.10, but I am getting an error when using python 3.11:

Traceback (most recent call last):
  File "conda/ab4cfd88406b26cee96aeae742579772_/bin/csvformat", line 8, in <module>
    from csvkit.utilities.csvformat import launch_new_instance
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/csvkit/__init__.py", line 15, in <module>
    import agate
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/__init__.py", line 5, in <module>
    from agate.aggregations import *
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/aggregations/__init__.py", line 22, in <module>
    from agate.aggregations.count import Count  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/aggregations/count.py", line 5, in <module>
    from agate.utils import default
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/utils.py", line 9, in <module>
    from collections import OrderedDict, Sequence
ImportError: cannot import name 'Sequence' from 'collections' (conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/collections/__init__.py)
Traceback (most recent call last):
  File "conda/ab4cfd88406b26cee96aeae742579772_/bin/csvcut", line 8, in <module>
    from csvkit.utilities.csvcut import launch_new_instance
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/csvkit/__init__.py", line 15, in <module>
    import agate
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/__init__.py", line 5, in <module>
    from agate.aggregations import *
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/aggregations/__init__.py", line 22, in <module>
    from agate.aggregations.count import Count  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/aggregations/count.py", line 5, in <module>
    from agate.utils import default
  File "conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/site-packages/agate/utils.py", line 9, in <module>
    from collections import OrderedDict, Sequence
ImportError: cannot import name 'Sequence' from 'collections' (conda/ab4cfd88406b26cee96aeae742579772_/lib/python3.11/collections/__init__.py)

Since csvkit does not seem to be compatibe with python 3.11, shouldn't the python version be specified on the conda-forge recipe?
thanks,

Please upgrade agate (pip install -U agate) to 1.6.3 or 1.6.2. You are using a version from before 2020.

Since I installed csvkit through conda, shouldn't a minimum version specification for agate be specified in the conda recipe?

I don't maintain the conda recipe. You will have to address this issue to the conda maintainers.