Forums

Issue importing the json module

Hi,

I get an error while importing the module in any console, including brand new ones.

Please help

import json Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.7/json/init.py", line 106, in <module> from .decoder import JSONDecoder, JSONDecodeError File "/usr/lib/python3.7/json/decoder.py", line 5, in <module> from json import scanner File "/usr/lib/python3.7/json/scanner.py", line 5, in <module> from _json import make_scanner as c_make_scanner File "/home/elacourisere/_json.py", line 5, in <module> data = json.load(monjson) AttributeError: module 'json' has no attribute 'load'

You have a module or something called json that is being imported instead of json. After you import json, check json.file to find out where it is.

You’re right, thanks!

Glad we could help :-)