I've been trying to add one of my folders where I hold my python modules and, so far, I haven't been able to do it through AWS's terminal. The folder with the .py
files is inside the main SageMaker
folder, so I'm trying (I've also tried it with SageMaker/zds
, which is the folder that holds the modules):
export PYTHONPATH="${PYTHONPATH}:SageMaker/"
After printing the directories of the PYTHONPATH
through the terminal with python -c "import sys; print('\n'.join(sys.path))"
, I get that indeed my new path is included in the PYTHONPATH
. However, when I try to import any module from any notebook (with from zds.module import *
or from module import *
), I get the error that the module doesn't exist. If I print the paths from the PYTHONPATH
directly inside the notebook I no longer see the previously added path in the list.
Am I missing something basic here or is it not possible to add paths to the PYTHONPATH
inside AWS SageMaker? For now, I'm having to use import sys, os
sys.path.insert(0, os.path.abspath('..'))
inside basically every notebook as a fix to the problem.