Forum Archive

ModuleNotFound Error

Wences

Trying to learn Python using Pythonista whilst commuting to work by following a course that uses another software to code on Python.

One of the exercises creates a class in a different file, and by using the from file.py import Class instruction on a different file, I get the ModuleNotFound Error message.

Both files are saved in the same “folder” within Pythonista so I did not expect to include a path to the file that contains the class.

Do I need to use another software to enable the use of external classes / modules, do they have to be in a specific folder for Pythonista to know where the source is, or am I missing something else?

Any help would be appreciated.

cvp

@Wences try "from file import ..." without specifying .py and be sure your "Class" is correctly written (uppercase or not)

Wences

Thanks, took the .py extension and worked!

Thanks for your help!