I have a module that I use in a number of scripts. Its path is C:\PYTHONprojects\utilities\utility_module.py
There is an (empty) file called __init__.py
in the same folder.
If I import the module inside the PyCharm environment, it works fine:
import utility_module as um
but if do the same from the Python command line, I get:
ModuleNotFoundError: No module named 'utility_module'
But the folder is in the PATH: From the windows command line: In: PATH
Out:
......
C:\PYTHONprojects\utilities; C:\PYTHONprojects
.....
or from the Python Command Line:
In: import sys
sys.path
Out:
......
'C:\\PYTHONprojects', 'C:\\PYTHONprojects\\utilities'