I am running Python 3.6.1 on a Windows 7 machine. I have some scripts in H:\Myname\Python\myscripts.
I have created the user variable PYTHONPATH and set it to the folder above. I do not have admin rights so I can create a user variable only.
In that folder, I have a myscripts.py file with some functions.
If I try to access it running import myscripts from a file stored elsewhere, it doesn't work: I get a ModuleNotFoundError
If I print sys.path, the folder I have set in PYTHONPATH is not there.
Why? What am I doing wrong? Isn't sys.path supposed to show PYTHONPATH?
Does the fact that H is a network drive have anything to do with it?
I can't seem to find anything on the web for this problem in relation to Windows (but lots for Unix systems).
A common way to fix this quickly is to use
sys.path.append("path/to/module")
Be careful with '\\' if you are using Windows.
Not exactly answering your question but this could fix the problem.
Cannot import module - why does sys.path not find PYTHONPATH?