Hi there,
I have problems importing a module based on environment variables. I’m working on Windows 10.
My module is here:
D:/Boulot/processing/python/scripts/pouic_random/lib/basic.py
I added those env variables:
Path = %PYTHONPATH%
PYTHONPATH = 'C:/python37,%PROCESSING_LIB%'
PROCESSING_LIB = 'D:/work/processing/python'
This does not work:
import scripts.pouic_random.lib.basic as basic
ModuleNotFoundError: No module named ‘scripts’
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u “C:\Users\Ben\Desktop\pyTest.py”]
[dir: C:\Users\Ben\Desktop]
[path: %PYTHONPATH%] (I cleaned this output so that stays readable)
%PYTHONPATH% does not seems to be unpacked in the error message while this works without any problem:
os.environ.get('Path')
C:\Python37;C:\Python37\Scripts;D:\Boulot\processing\python;
While this works:
import sys
sys.path.append(r'D:\Boulot\processing\python')
import scripts.pouic_random.lib.basic as basic
What seems to be the problem here? Does nested en var work this way? It seems strange that Sublime Text does not unpack %PYTHONPATH% in the error message.
I got the exact same problem if I put 'D:/work/processing/python'
to Path or to PYTHONPATH.
Thanks!