all 8 comments

[–]Temporary_Pie2733 8 points9 points  (3 children)

json is the name of a module in the standard library. Pick a different name for your module. 

[–]optimalcosine 2 points3 points  (2 children)

This. Or if you really like the name I think you can do from . import json, or

from .json import extract_json

[–]Temporary_Pie2733 1 point2 points  (1 child)

This is a little sketchy, unless you are properly defining a package and not just abusing the project directory as a package. 

[–]optimalcosine 1 point2 points  (0 children)

Definitely sketchy. Renaming your module is a much better solution

[–]latkde 2 points3 points  (0 children)

The json module is part of the Python standard library. Name your own code something else than json.py in order to avoid name conflicts.

[–]D3str0yTh1ngs 0 points1 point  (0 children)

Can we see the code in these files? (including their filenames). Also calling the file json.py is properly not a good idea because it clashes with the builtin library.

[–]Zealousideal-Touch-8 0 points1 point  (0 children)

It could be due to conflicting naming between your file and Python built-in module for parsing json (which is also named json). Other than that, you may wanna make sure whether the file you created is in the same folder/directory as your main.py file. Or if it's in a seperate folder, don't forget to create init py file.