Pandas fails with dateutil/tz.py line 78 `self._name`, invalid syntax

Viewed 1208

I have a pretty simple Prophet script that I'm running on a RHEL 6.6 Santiago system. When I run it, I get this traceback

Traceback (most recent call last):
  File "working_v1_runSplunkProphet.py", line 7, in <module>
    import pandas as pd
  File "/home/scadmin/prophet/lib/python3.6/site-packages/pandas/__init__.py", line 30, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "/home/scadmin/prophet/lib/python3.6/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
  File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
  File "/home/scadmin/prophet/lib/python3.6/site-packages/pandas/_libs/tslibs/__init__.py", line 30, in <module>
    from .conversion import OutOfBoundsTimedelta, localize_pydatetime
  File "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
  File "pandas/_libs/tslibs/timezones.pyx", line 7, in init pandas._libs.tslibs.timezones
  File "/usr/local/lib/python3.6/dateutil/tz.py", line 78
    `self._name`,
    ^
SyntaxError: invalid syntax

I'm using python3.6 (3.6.8) and pip 21.0.1 from venv/lib/python3.6.site-packages/pip (python 3.6). I have also tried this outside the virtual env (same versions) and get the same traceback. I'm using pandas 1.1.15 and dateutil 2.8.1.

I've tried doing below as suggested from Pandas import issues.

pip uninstall python-dateutil
pip install python-dateutil --upgrade

I had this problem not too long ago and was able to fix it, but I can't remember what the fix was or seem to find the fix that worked last time.

Any help you can offer is much appreciated.

0 Answers
Related