Python 3.x在WIN7下安装

来源:互联网 发布:阿里云备案拍照ps 编辑:程序博客网 时间:2024/06/05 18:34

背景:之前建个人站点gnssinfo.com曾从网上download了一个开源的python 2.x版本的工具,用来从163上下载blog;
这两天把python 2.7删掉,然后安装最新版3.3,无法启动,换装3.2同样无法启动,均提示以下错误:

Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can’t find encoding

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

用控制台启动,查询版本,报如下错误:

E:\Python32>python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can’t find encoding

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

百度不给力,google了N久,终于在python.org网站上找到答案,具体页面为:http://bugs.python.org/issue11288
原网页提示解决方案如下:

I have found a problem and sollution:
previously I have used Python 2.x and when I removed that version and next installed Python32, PYTHONPATH in system variabled indicated still to Python2.x. Removing all python paths to old version solved the problem.

与笔者电脑上问题一样,找到系统高级环境变量设置,将PYTHONPATH更改指向E:\Python32目录。重新从菜单打开IDLE(Python GUI)即可启动。
IDLE启动后,界面提示信息如下:
Python 3.2.2 (default, Sep 4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win32
Type “copyright”, “credits” or “license()” for more information.
>>>

0 0