Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
272 views
in Technique[技术] by (71.8m points)

python - Python3 installed successfully, but cannot be opened in terminal

Yesterday I've reinstalled my Mac OS X 10.8, before this reinstallation there were python2.7.5 and python3.3.2 installed on my machine and worked fine, but after this system reinstallation I cannot open python3 again. So I downloaded the DMG package of Python3 and reinstalled it again, but it still throwing this exception in terminal:

Fatal Python error: Py_Initialize: unable to load the file system codec 
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.py", line 123
raise CodecRegistryError,
                        ^
SyntaxError: invalid syntax
Abort trap: 6

Then a system problem report window appeared: it said:

Process:         Python [51780]
Path:            /Library/Frameworks/Python.framework/Versions/3.3/Resources/Python.app/Contents/MacOS/Python
Identifier:      Python
Version:         3.3.2 (3.3.2)
Code Type:       X86-64 (Native)
Parent Process:  bash [51586]
User ID:         501

Date/Time:       2013-09-23 00:40:19.908 +0800
OS Version:      Mac OS X 10.8.5 (12F37)
Report Version:  10

Interval Since Last Report:          77033 sec
Crashes Since Last Report:           1982088234
Per-App Crashes Since Last Report:   4
Anonymous UUID:                      1FEE4EB2-0D26-4DDF-9954-4423C040AECB

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The solution is to unset $PYTHONPATH, then everything goes on well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...