Open heikowestermann opened 2 years ago
Hi, I've got the same problem. It did suddenly appear but I can't figure the reason. I tried to create new virtualenv from scratch but it doesn't change anything.
Python version: 3.9.6
I tried multiple versions for python-dateutil but it does show the same error while importing pandas:
ImportError: cannot import name 'ParserError' from 'dateutil.parser'
It is quite annoying because my whole python can't work because of that since the main libraries I use have depency with dateutil
I have the same issue with python 3.9
I solved this issue with python 3.10. I was able to import pandas with no problem
The requirements.txt
doesn't ask for python-dateutil-2.8.0
, but rather python-dateutil~=2.8
, which means >=2.8.0,<3.0.0
.
Since ParserError
was added in 2.8.1
, I guess that should really be >=2.8.1,<3.0.0
. Feel free to make a PR to that effect.
I'm a bit confused about how you are installing your dependencies however? Doing pip install -r requirements.txt
should generally install the latest matching version (subject to other constraints). For me that's 2.8.2
, hence why its been passing tests.
Describe the bug requirements.txt asks for python-dateutil-2.8.0 which does not have the required exception ParserError and results in an ImportError
Steps to Reproduce Install python-dateutil-2.8.0 and run statham
Expected behaviour No ImportError
Actual behaviour ImportError: cannot import name 'ParserError' from 'dateutil.parser'
System information
Workaround Install the most recent version of python-dateutil (2.8.2)
Additional context Easy fix: Bump the required python-dateutil from 2.8.0 to 2.8.2