Import pandas error after upgrading version. python3.8 problem?

After upgrading pandas version, I cannot import pandas anymore. The error traces to module ‘typing’:
AttributeError: module 'typing' has no attribute '_ClassVar'

After diving into stackoverflow. this seems to be a problem with ‘typing’ not being compatible with newer python versions: python - AttributeError: type object 'Callable' has no attribute '_abc_registry' - Stack Overflow

Can anyone please advice me on how to fix this? I am thinking downgrading to python3.6 or 3.7 is the solution here, anybody knows how?


Hello Yosse,

We got a report of this problem by another user, he opened this ticket:

There is a proposed workaround that you can try.

1 Like

Thanks for the pointer! I can confirm the workaround works.
I sure hope the bug gets resolved soon.

Hi again Enric,

Unfortunately this workaround does not work in swan-k8s. It returns this error:
Traceback (most recent call last):

  File "/cvmfs/", line 3296, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-6-027d28fa2663>", line 3, in <module>
    import pandas as pd

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/", line 51, in <module>
    from pandas.core.api import (

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/core/", line 31, in <module>
    from pandas.core.groupby import Grouper, NamedAgg

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/core/groupby/", line 1, in <module>
    from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/core/groupby/", line 65, in <module>
    from pandas.core.frame import DataFrame

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/core/", line 119, in <module>
    from pandas.core import algorithms, common as com, generic, nanops, ops

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/core/", line 112, in <module>
    from import format as fmt

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/io/formats/", line 77, in <module>
    from import stringify_path

  File "/eos/user/s/sandrean/.local/lib/python3.7/site-packages/pandas/io/", line 6, in <module>
    import dataclasses

  File "/cvmfs/", line 996
    def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False,
SyntaxError: invalid syntax

I notice k8s uses python 3.7. Is there any solution for this particular case?


In the SPI ticket above it says dataclasses were added as built-in in Python3.7, so perhaps you need to change to this path:


which is the corresponding one in the CUDA stack that you are using.

Could you please anyway report this issue with the CUDA stack too in the SPI ticket I referenced above?

We just removed the non standard lib from all the LCG_99 and LCG_99cuda views on cvmfs, it will probably take a couple hours to propagate.

1 Like

Thank you for the update Andre!

Thanks! I can confirm now import pandas work as per normal.