Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dev_appserver.py AssertionError (Windows)

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

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
assert 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.

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

like image 634
Robbie Avatar asked Sep 26 '26 04:09

Robbie


1 Answers

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

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

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

Python 2.7.17 Download

Hitchhiker's Guide to Installing Python 2 on Windows

Note: Python 2 has reached its end of life. 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.

Sunsetting Python 2

like image 158
John Hanley Avatar answered Sep 27 '26 21:09

John Hanley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!