When I try to import
a module named my_module.py
into the module i am working on named LEARNING PYTHON.py
, I get an error message saying:
Traceback (most recent call last):
File "/var/folders/tn/g0fq2j9d1hs6gss6db_4czwm0000gn/T/atom_script_tempfiles/2021710-52462-1bl6rr4.wrni", line 16, in <module>
import my_module
ModuleNotFoundError: No module named 'my_module'
I am running the latest version of python and pip on my Mac and as far as i know, both modules are in the same directory. For my_module.py
and LEARNING PYTHON.py
, when I print the directory using:
import os
print(os.getcwd())
the following is displayed for both modules:
/Users/dylanneal/Documents
Can someone tell me what I am doing wrong and how I can import my_module
in my LEARNING PYTHON.py
file?