Has anyone tried the new App Engine (dev_appserver) for Python 3 on Windows?

A few days ago was released a new version of Google Cloud CLI (468.0.0) that in the release notes says:

 

 

* Upgraded dev_appserver from Python 2 to Python 3.
...
* Python 2 is no longer supported and should not be needed in your environment.

 

 

I was very happy to see that, but when I go to the online documentation I found this:

App-Engine-on-Windows.JPG

 

 

 


However, the docs for Local development server options also say this:

still-py2.JPG

so maybe it does work on Windows and the docs haven't been updated?

Has anyone tried it?

Also, in that last docs page, I don't find the flag --python_virtualenv_path, which I'm using now with an older version of the CLI. I don't know if that's just missing from the docs or it was removed and now that functionality has to be achieved in another way when using dev_appserver.

I'm just trying to gather as much info as possible before instaling anything new in my dev. env. because I rely on it to maintain several apps. I'm using (on Windows 10) Python 3.9 (and Python 2.7 because it was still required to use dev_appserver) and CLI 431.0.0. My plan was to install in the same PC (without removing anything that is currently working) Python 3.10 and CLI 468.0.0 and progressively start migrating to the new versions, so that I don't need Python2 any more.

Any suggestions/comments (other than forgetting about Windows 🙂 ) would be appreciated.
Thanks.

 

Solved Solved
1 9 350
1 ACCEPTED SOLUTION

Just posting the solution here the way I got it:

1- I installed Python 3.11 without adding it to the Windows (env. var.)PATH, so whatever I had already setup and working on that PC stays the same.

2- Downloaded the desired new version (470.0.0) of the SDK/CLI (as a windows-x86_64.zip) from here.

3- Unzipped it to the same location that contains previous versions of the SDK/CLI just in a new folder for it ("C:\Program Files (x86)\Google\Cloud SDK 470")

4- Installed/updated components:

 

"C:\Program Files (x86)\Google\Cloud SDK 470\google-cloud-sdk\bin\gcloud" components install app-engine-python-extras

 



5- Got and installed the latest patch for Windows from @NoCommandLine  from here.

6- Modified the batch file that starts dev_appserver for each application that I'm upgrading.

 

<path_to_python311>\python.exe <path_to_CLI470>\bin\dev_appserver.py 
--runtime_python_path=<path_to_python311>\python.exe 
--python_virtualenv_path=<path_to_my_app>\myvenv311\ 
--datastore_path=<path_to_my_datastore>\db.datastore
<path_to_my_app>\

 


7- Changed first line of the application's app.yaml file to:

 

runtime: python311

 

I think that's it. Now I have the applications in the same PC still running on Python39+CLI431 (which still requires Python27) and also Python311+CLI470 sharing the same datastore and that's causing a minor issue that I'm documenting (asking for a solution) here.

Also, tested deleting (actually renaming) the env.var. CLOUDSDK_DEVAPPSERVER_PYTHON and Python39+CLI431 stops working, but running with Python311+CLI470 still works, so I guess that proves that in fact Python27 is no longer needed in dev.

View solution in original post

9 REPLIES 9

Hi @micdearmas,

Welcome to Google Cloud Community!

There is a workaround that was published by NoCommandLine that you may want to try as dev_appserver tool doesn't work on Windows. Please check this link on using dev_appserver.py for Python 3 Apps on Windows.

You may also check the following links that is related to your question:

If the steps didn't work, you may file a feature request so that our engineers could take a look at this. We don't have a specific ETA once the ticket has been created.

Hope this helps.

Thank you @robertcarlos ,

I've been using the patch from @NoCommandLine for a while now and I was just wondering if this brand new version released just a few days ago wouldn't need the patch anymore. From your answer, I guess I should assume that it still doesn't work on Windows out of the box and that the existing patch still works with the new version of the CLI.

I'll see if I can make it work without breaking anything that is now working in my dev. env. and if I succeed (meaning that I don't need Python 2.7 anymore); then, I'll look into running things without the use dev_appserver, but still using all the functionality within google.appengine.api in Python 3 alone, as that's the other big question I have about this release.

Thanks again.

FYI -

Someone on gcloud SDK460.0.0 found out the patch didn't work on that version. They had to downgrade to a lower version of gcloud SDK to use the patch. 

I haven't had time to take a look at changes in newer version of gcloud SDK and if it has any impacts on the patch (and update the patch if necessary).

 

......NoCommandLine ......
 https://nocommandline.com
      Analytics & GUI for 
App Engine & Datastore Emulator

Thank you @NoCommandLine for the heads up!

I guess my getting rid of Python 2.7 will have to wait a little longer 😪

Is there a way to subscribe (to some kind of release notes) to get an email when a new release of the patch is made available?

I'll send you a message via this forum or you can look at Github subscriptions

 

.....NoCommandLine ......
 https://nocommandline.com
      Analytics & GUI for 
App Engine & Datastore Emulator

There was a new release yesterday with changes to devappserver. I'm not sure about the specifics of the change (other than changing the version number), but I thought it might affect this.

@micdearmas 

A new version of the Patch to support gcloud SDK v470.0.0 is now available. You can find it here.

There is a known issue and it's described here  Issue has been fixed.

 

.....NoCommandLine ......
 https://nocommandline.com
      Analytics & GUI for 
App Engine & Datastore Emulator

Terrific!

Thanks a lot @NoCommandLine; I'll make sure to contribute a tip later this week 🙂

Just posting the solution here the way I got it:

1- I installed Python 3.11 without adding it to the Windows (env. var.)PATH, so whatever I had already setup and working on that PC stays the same.

2- Downloaded the desired new version (470.0.0) of the SDK/CLI (as a windows-x86_64.zip) from here.

3- Unzipped it to the same location that contains previous versions of the SDK/CLI just in a new folder for it ("C:\Program Files (x86)\Google\Cloud SDK 470")

4- Installed/updated components:

 

"C:\Program Files (x86)\Google\Cloud SDK 470\google-cloud-sdk\bin\gcloud" components install app-engine-python-extras

 



5- Got and installed the latest patch for Windows from @NoCommandLine  from here.

6- Modified the batch file that starts dev_appserver for each application that I'm upgrading.

 

<path_to_python311>\python.exe <path_to_CLI470>\bin\dev_appserver.py 
--runtime_python_path=<path_to_python311>\python.exe 
--python_virtualenv_path=<path_to_my_app>\myvenv311\ 
--datastore_path=<path_to_my_datastore>\db.datastore
<path_to_my_app>\

 


7- Changed first line of the application's app.yaml file to:

 

runtime: python311

 

I think that's it. Now I have the applications in the same PC still running on Python39+CLI431 (which still requires Python27) and also Python311+CLI470 sharing the same datastore and that's causing a minor issue that I'm documenting (asking for a solution) here.

Also, tested deleting (actually renaming) the env.var. CLOUDSDK_DEVAPPSERVER_PYTHON and Python39+CLI431 stops working, but running with Python311+CLI470 still works, so I guess that proves that in fact Python27 is no longer needed in dev.