I am trying to install Python for the first time. I downloaded the following installer from the Python website: Python 2.7.1 Windows Installer (Windows binary -- does not include source). I then ran the installer, selected 'All Users' and all was fine. I installed Python into the default location:
C:\Python27
Next, to test that Python was installed correctly, I navigated to my Python Directory, and ran the "python" command in the windows cmd prompt. It returns me the following error:
ImportError: No module named site
When I do 'python -v' I get the following:
#installing zipimport hook#installed zipimport hook
import zipimport # builtin#ImportError: No module named site#clear builtin._#clear sys.path#clear sys.argv#clear sys.ps1#clear sys.ps2#clear sys.exitfunc#clear sys.exc_type#clear sys.exc_value#clear sys.exc_traceback#clear sys.last_type#clear sys.last_value#clear sys.last_traceback#clear sys.path_hooks#clear sys.path_importer_cache#clear sys.meta_path#clear sys.flags#clear sys.float_info#restore sys.stdin#restore sys.stdout#restore sys.stderr#cleanup main#cleanup[1] zipimport#cleanup[1] signal#cleanup[1] exceptions#cleanup[1] _warnings#cleanup sys#cleanup builtin#cleanup ints: 6 unfreed ints#cleanup floats
When I do dir C:\Python27\Lib\site.py* I get the following:
C:\Users\Mimminito>dir C:\Python27\Lib\site.py*
Volume in drive C has no label.
Volume Serial Number is DAB9-A863Directory of C:\Python27\Lib
13/11/2010 20:08 20,389 site.py
1 File(s) 20,389 bytes
0 Dir(s) 694,910,976 bytes free
Any ideas?
PYTHONPATH. I converted it to a windows style path withexport PYTHONPATH=$(cygpath -w $PYTHONPATH)and it works fine. Adding this note to help other people that may come to this page with the same problem. - robert