79372679

Date: 2025-01-20 21:27:57
Score: 2.5
Natty:
Report link

After some investigation, I realized what was happening when I saw a line of code from a different file showing up in the error message, even though I was working on a different script. It turns out I had named my script code.py, which clashed with Python’s built-in code module. So, when Python tried to import the code module, it ended up importing my script by mistake, causing the error. The fix was simple: I just renamed my script to something other than code.py, and that resolved the issue.

Reasons:
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mathieu BOSSE