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
262 views
in Technique[技术] by (71.8m points)

python - dev_appserver.py AssertionError(Windows)(dev_appserver.py AssertionError (Windows))

When I type "dev_appserver.py" in windows command prompt I receive:

(当我在Windows命令提示符下键入“ dev_appserver.py”时,我收到:)

Traceback (most recent call last):

(追溯(最近一次通话):)
File "C:\Users\computername\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\dev_appserver.py", line 95, in

(文件“ C:\ Users \计算机名\ AppData \ Local \ Google \ Cloud SDK \ google-cloud-sdk \ platform \ google_appengine \ dev_appserver.py”,在第95行中)
assert sys.version_info[0] == 2

(断言sys.version_info [0] == 2)
AssertionError

(断言错误)

Why is this?

(为什么是这样?)

I can't run the program?

(我无法运行该程序?)

Why would there be an assertion error.

(为什么会有断言错误。)

Please help!

(请帮忙!)

I can't run a local cloud engine server on windows currently.

(我目前无法在Windows上运行本地云引擎服务器。)

For what it's worth I've tried with python 3.7, 3.8, and 2.7... all with the same issue.

(对于值得的我已经尝试使用python 3.7、3.8和2.7 ...都具有相同的问题。)

  ask by Robbie translate from so

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

1 Reply

0 votes
by (71.8m points)

The assert statement sys.version_info[0] == 2 means that the major version number of Python must be 2, otherwise the program will abort.

(assert语句sys.version_info[0] == 2表示Python的主要版本号必须为2,否则程序将中止。)

You are running the Python program with Python 3. To verify type python -V .

(您正在使用Python 3运行Python程序。要验证类型python -V 。)

Install Python 2 on your system and set up the correct paths, etc. Read the documentation for your system.

(在系统上安装Python 2并设置正确的路径等。请阅读系统的文档。)

Python 2.7.17 Download

(Python 2.7.17下载)

Hitchhiker's Guide to Installing Python 2 on Windows

(在Windows上安装Python 2的Hitchhiker指南)

Note: Python 2 has reached its end of life.

(注意:Python 2已经到了使用寿命。)

There is still a lot of software and libraries for Python 2, but be aware that most new development is for Python 3. There are many new features for Python 3 that make the transition worthwhile.

(仍然有许多适用于Python 2的软件和库,但请注意,大多数新开发都针对Python3。Python3的许多新功能使过渡值得。)

Sunsetting Python 2

(日落Python 2)


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

...