python SOMETIMES os.environ has no pythonpath
Question: if i run the following script in Aptana Studio 3:

    
    
    import os
    from pprint import pprint
    pprint(os.environ['PYTHONPATH'].split(os.pathsep))
    

I get the following output:

    
    
    ['C:\\Users\\Phocas_Tommy\\plugins\\org.python.pydev_3.0.0.1388187472\\pysrc\\pydev_sitecustomize',
     'D:\\Phocas\\Phocas-Automation',
     'D:\\Phocas\\Phocas-Automation\\analytics',
     'C:\\Users\\Phocas_Tommy\\plugins\\org.python.pydev_2.7.0.2013032300\\pysrc',
     'C:\\Windows\\system32\\python27.zip',
     'C:\\Python27\\DLLs',
     'C:\\Python27\\lib',
     'C:\\Python27\\lib\\plat-win',
     'C:\\Python27\\lib\\lib-tk',
     'C:\\Python27',
     'C:\\Python27\\lib\\site-packages']
    

If i run the same script in sublime text 3 i get the this error:

    
    
    Traceback (most recent call last):
      File "D:\Phocas\Phocas-Automation\scrapbook.py", line 3, in <module>
        pprint(os.environ['PYTHONPATH'].split(os.pathsep))
      File "C:\Python27\lib\os.py", line 423, in __getitem__
        return self.data[key.upper()]
    KeyError: 'PYTHONPATH'
    

Totally confused - Could it be something to do with a project file being read
by Aptana, telling the interpreter where to look for the PYTHONPATH? I don't
understand why os.environ['PYTHONPATH'] is completely absent when i run it in
sublime.

I'm using python 2.7 on Windows Server 2008 R2 Standard


Answer: PYTHONPATH is an environment variable. How are you starting Sublime Text 3?
Why do you think the environment in which it runs should have a PYTHONPATH
setting? Can you run Sublime Text from the command line?

The bottom line is that Sublime Text does not appear to be running in the same
environment as it is in Aptana Studio.

