這個問題的緣由是readline 包的問題,能夠從新編譯,替換
java
下載python3.4源碼python
https://www.python.org/ftp/python/3.4.0/測試
解壓進入到源碼包中vi setup.pycode
找到代碼:源碼
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include'
在該行代碼前面加入兩行代碼 python包目錄
it
add_dir_to_list(self.compiler.library_dirs, '/opt/local/lib') add_dir_to_list(self.compiler.include_dirs, '/opt/local/include') add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
執行io
./configure --enable-framework MACOSX_DEPLOYMENT_TARGET=10.5 --with-universal-archs=all $ make
將從新編譯後的readline.so文件拷貝到編譯
cp readline.so /System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/
關閉命令窗口從新打開 輸入python命令 測試
class