Getting error while using json and simple json in .py file

663 Views Asked by At

When I used import json getting error as ImportError: cannot import name 'JSONDecodeError' from 'json' (unknown location)

After few research i changed as

try:
    import simplejson as json
except ValueError:
    import json

now new error is AttributeError: module 'json' has no attribute 'dumps' Can anyone help me to understand that what's happening here? and I'm using Python 3.9V

1

There are 1 best solutions below

0
Pari On

I just uninstalled Json extension package from my pip list and it worked without any mentioned error.