简体   繁体   English

Python Cmd / Powershell错误“跟踪(最近一次调用最近)”

[英]Python Cmd/Powershell error “Traceback (Most recent call last)”

I was giving a look at the " Learn Python The Hard Way " tutorial and when it told me to try it out by typing Python in Powershell after I installed it just kept giving me this: 我正在看“ 学习Python的艰难方法 ”教程,当它告诉我在安装后在Powershell中键入Python尝试一下时,它一直在给我这样的提示:

PS C:\Users\Zach> python
Traceback (most recent call last):
File "C:\Python27\lib\site.py", line 548, in <module>
main()
File "C:\Python27\lib\site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "C:\Python27\lib\site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "C:\Python27\lib\site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "C:\Python27\lib\site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "C:\Python27\lib\sysconfig.py", line 516, in get_config_var
return get_config_vars().get(name)
File "C:\Python27\lib\sysconfig.py", line 449, in get_config_vars
import re
File "C:\Python27\lib\re.py", line 105, in <module>
import sre_compile
File "C:\Python27\lib\sre_compile.py", line 14, in <module>
import sre_parse
File "C:\Python27\lib\sre_parse.py", line 17, in <module>
from sre_constants import *
File "C:\Python27\lib\sre_constants.py", line 18, in <module>
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT

I also tried running through the command prompt and got the same error. 我还尝试通过命令提示符运行,并得到相同的错误。 I've installed and uninstalled python about 3 times and have done a few reboots to no avail. 我已经安装和卸载了python大约3次,并且进行了几次重启都无济于事。 I am very new to python and I'm confused on what to do here. 我是python的新手,我对在这里做什么感到困惑。 I would also appreciate any links to other python tutorials. 我还要感谢其他python教程的任何链接。

In this case, from my understanding, you have no modules called "MAXREPEAT" or you(or the installer) have installed it somewhere wrong. 在我看来,在这种情况下,您没有名为“ MAXREPEAT”的模块,或者您(或安装程序)已将其安装在错误的位置。 A reinstallation or redirecting the path should get it to work. 重新安装或重定向路径应使其正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM