"ImportError: No module named site" on Windows
I've been looking into this problem for myself for almost a day and finally had a breakthrough. Try this:
-
Setting the PYTHONPATH / PYTHONHOME variables
Right click the Computer icon in the start menu, go to properties. On the left tab, go to Advanced system settings. In the window that comes up, go to the Advanced tab, then at the bottom click Environment Variables. Click in the list of user variables and start typing Python, and repeat for System variables, just to make certain that you don't have mis-set variables for PYTHONPATH or PYTHONHOME. Next, add new variables (I did in System rather than User, although it may work for User too): PYTHONPATH, set to C:\Python27\Lib.
PYTHONHOME
, set to C:\Python27.
Hope this helps!
Quick solution: set PYTHONHOME and PYTHONPATH and include PYTHONHOME on PATH
For example if you installed to c:\Python27
set PYTHONHOME=c:\Python27
set PYTHONPATH=c:\Python27\Lib
set PATH=%PYTHONHOME%;%PATH%
Make sure you don't have a trailing '\' on the PYTHON* vars, this seems to break it aswel.