unset PYTHONHOME
시스템 기본값을 사용하거나 export PYTHONHOME=/usr
을 사용하여 파이썬이 '/lib/python2.7'(또는 어떤 버전이든)을 추가하여 접두사를 지정할 수 있습니다.
export PYTHONHOME=/usr/lib/python2.7
인 경우 Python은 존재하지 않는 폴더 /usr/lib/python2.7/lib/python2.7
에서 라이브러리를 찾습니다.
하고 export PYTHONHOME=
경우, 현재 작업 디렉토리에 lib
를 찾기 위해 파이썬을 말하고있다 : 당신의 파이썬 경로 설정을 해제 할 수
[email protected]:~$ PYTHONHOME= strace -estat64 /usr/bin/python
stat64("lib/python2.7/", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
stat64("lib/python2.7/", 0xff873efc) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7/plat-i386-linux-gnu", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
stat64("lib/python2.7/plat-i386-linux-gnu", 0xff873efc) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7/lib-tk", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
stat64("lib/python2.7/lib-tk", 0xff873efc) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7/lib-old", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
stat64("lib/python2.7/lib-old", 0xff873efc) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7/lib-dynload", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib/python2.7", 0xff870ee0) = -1 ENOENT (No such file or directory)
stat64("lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
stat64("lib/python2.7/lib-dynload", 0xff873efc) = -1 ENOENT (No such file or directory)
ImportError: No module named site
예! 그 일을, 정말 고마워! apt-get install을 사용하여 액세스 한 matplotlib 버전은 최신 버전이 아닙니다 ... sudo pip install --upgrade matplotlib를 사용해 보았지만 "python setup.py egg_info 명령이 오류 코드 1로 실패했습니다"라는 메시지가 나타납니다. 나는 그것을 그냥두고 내일을 시도하고 해결할지도 모른다. – user2635779
안녕하세요. 그게 효과가 있다면 답변을 수락하십시오, 이것은 또한 답이없는 질문 목록에서 귀하의 질문을 제거합니다. 건배 –
export PYTHONHOME =/usr/ 나를 위해 해줬습니다 – bennos