I am using a software environment loaded with the Environment Modules package (not to be confused with Python modules) using module load my_env. Within this environment, I am attempting to run a python script that imports a self-defined Python module using import my_py_module. When I tried to run this script, an error is reported saying
ModuleNotFoundError: No module named 'my_py_module'
How can I solve this issue?
The
my_envmodulefile should update thePYTHONPATHenvironment variable to add the location of themy_py_module.Once such modulefile is loaded, you should be able to run a python script that imports
my_py_module: