처음으로 Python을 설치하려고합니다. Python 웹 사이트에서 다음 설치 프로그램을 다운로드했습니다. Python 2.7.1 Windows Installer (Windows 바이너리-소스는 포함되지 않음) . 그런 다음 설치 프로그램을 실행하고 '모든 사용자'를 선택했는데 모두 괜찮 았습니다. 기본 위치에 Python을 설치했습니다.
C:\Python27
다음으로 Python이 올바르게 설치되었는지 테스트하기 위해 Python 디렉토리로 이동하여 Windows cmd 프롬프트에서 "python"명령을 실행했습니다. 다음 오류가 반환됩니다.
ImportError : site라는 모듈이 없습니다.
'python -v'를 수행하면 다음과 같이 표시됩니다.
#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] 신호
#cleanup[1] exceptions#cleanup[1] _warnings
#cleanup sys#cleanup builtin
#cleanup ints: 6 unfreed ints#cleanup floats
내가 dir을 할 때 C:\Python27\Lib\site.py*다음을 얻습니다.
C : \ Users \ Mimminito> dir C : \ Python27 \ Lib \ site.py *
C 드라이브의 볼륨에는 레이블이 없습니다.
볼륨 일련 번호는 DAB9-A863입니다.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
어떤 아이디어?
PYTHONPATH. 나는 그것을 Windows 스타일 경로로 변환했고 export PYTHONPATH=$(cygpath -w $PYTHONPATH)잘 작동합니다. 같은 문제로이 페이지를 방문 할 수있는 다른 사람들을 돕기 위해이 메모를 추가합니다.