PyScripter: Why might some modules import personal modules while others dnot?

Viewed 192

I am using PyScripter to implement a lesson from the Python Tutorial: https://docs.python.org/3.7/tutorial/modules.html#more-on-modules

However, when I attempt to import my own module quadform.py in a separate code by calling

import quadform  
quadform.quad_form(1,1,-6)

I get the error:

Traceback (most recent call last):
  File "<module1>", line 1, in <module>
ModuleNotFoundError: No module named 'quadform'

Even more confusing is that when I copy + paste the exact code into a separate module saved in the same location, the import on the second module does works. Since then, I have tried various permutations of syntax, using different IDEs, calling from different modules, calling from the shell, and fiddling with the Path in Environment Variables with only a few successes and seemingly at random.

Can someone explain what might be the issue? At the moment, I cannot reliably call any of my modules without getting the same error. I am a beginner trying to pick up Python (and programming in general) on my own so any help would be greatly appreciated.

1 Answers
Related