ImportError:无法导入名称别名

时间:2011-01-16 17:58:17

标签: python windows installation

我刚刚使用official site中的安装程序在Windows Vista上安装了Python 2.7.1,并在运行python.exe时出现此错误

C:\Python27>python.exe
Traceback (most recent call last):
  File "C:\Python27\Lib\site.py", line 553, in <module>
    main()
  File "C:\Python27\Lib\site.py", line 542, in main
    aliasmbcs()
  File "C:\Python27\Lib\site.py", line 467, in aliasmbcs
    import locale, codecs
  File "C:\Python27\Lib\locale.py", line 15, in <module>
    import encodings
  File "C:\Python27\Lib\encodings\__init__.py", line 32, in <module>
    from encodings import aliases
ImportError: cannot import name aliases

使用Python 3.1.3,也刚安装

Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "C:\Python31\lib\encodings\__init__.py", line 32, in <module>
ImportError: cannot import name aliases

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

发生了什么事?我应该配置PYTHONPATH还是这样的东西?如果是这样,它应该有什么价值?

1 个答案:

答案 0 :(得分:3)

我能找到的唯一参考指向病毒问题:

从这里开始:http://mail.python.org/pipermail/tutor/2009-January/066730.html 通过:http://mail.python.org/pipermail/tutor/2009-January/066739.html 并结束:http://mail.python.org/pipermail/tutor/2009-January/066750.html

如果您的\Lib\encodings\aliases.py丢失且您无法在那里创建具有该名称的文件,请开始寻找该木马。