Discussion on question by user2153235: PYTHONPATH not propagating from CMD to Spyder
PYTHONPATH is defined correct in the batch file SpyderSpark.cmd. cmd.exe calls CreateProcess always with a NULL pointer for the function parameter lpEnvironment. PYTHONPATH should exist in os.environ of first executed pythonw.exe as defined in the batch file. The Python script cwp.py of Anaconda 3 is copying this environment, modifying PATH (not PYTHONPATH) and calling CreateProcess for running a second pythonw.exe with own set of environment variables with just a modified PATH in this set of variables.
Read more here: Source link
