App Engine is not supported for python 3 in pycharm - python

I want to create a google app engine project in pycharm. I select python 3, give my project a name.
And it's written that App Engine is not supported for the selected interpreter
I can choose python 2.7 and it is working but why can't I choose python 3.6? I even tried 3.5, same problem. However in official documentation it supports python 3.6...
I'm sure I have installed google app flexible environment
I'll leave there a screen of pycharm just in case gdrive link

AFAIK PyCharm's GAE support means:
ability to run/debug a GAE app project using the SDK's dev_appserver.py - which is only supported for the standard environment
ability to deploy on GAE using the SDK utilities - which not long ago didn't even support well apps with multiple standard environment services - I had to deploy my app manually.
In other words PyCharm doesn't offer real/significant benefits for the flexible env GAE apps, you'll have to complement it with manual ops or scripts anyways.
So I'd just create a regular python 3.5/3.6 project and simply not specify it's also a GAE project.

Related

Extensions not supported on Azure App Service Environment

We've recently moved from App Service to App Service Environment on Azure. We need Python 3.6 to run the web API. But we're not able to install the extensions. Are extensions disabled on App service environment. Azure by default offers Python 3.4.1. But few of the libraries need a minimum of 3.6.4 which is available as a extensions. Is there a workaround for this or are we limited to the default Python 3.4.1 available with Azure ?
In case you haven't seen already, see article
https://blogs.msdn.microsoft.com/pythonengineering/2016/08/04/upgrading-python-on-azure-app-service/
Microsoft says you can run newer versions, 3.4 is default purely to prevent breaking compatibility with existing sites.
Azure menu layout sometimes (annoyingly) changes from guides, but I was able to find it searching "Extensions" in the Menu for my App Service
This is indeed possible but took a bit of experimenting. I had to open the Kudu console from a VM which is inside the same VNet as the App Service Environment. From there on, it's a cake walk. You can also configure Web Jobs from the VM which is otherwise not possible from the portal.

How to use Python 3 with Google App Engine's Local Development Server

I've got a local Python application configured with
runtime: python
in it's app.yaml file. When starting the local development server with
dev_appserver.py app.yaml
all is fine.
Since GAE's Local Development Server uses Python2.7 by default, I now want to make use of Python3.x instead. According to Google's documentation, we have to use the flexible environment. Thus I'm changing app.yaml to:
runtime: python
env: flex
runtime_config:
python_version: 3
Now dev_appserver.py app.yaml spits out:
Under dev_appserver, runtime:python is not supported for Flexible environment.
The problem can be reproduced with Google's Hello World application that uses the flexible environment as well.
So locally we can't use Python3? How can we then run my Python3 code locally before uploading it?
Using the Local Development Server is applicable to the first generation standard environment apps only.
For running locally flexible env apps see Running locally:
You run your application locally with the native development tools
that you usually use.
For example, you can usually run a Flask application with Flask's
development server using:
python main.py
Django applications can be started using:
python manage.py runserver
Related: How to tell if a Google App Engine documentation page applies to the standard or the flexible environment
Update:
Support for the 2nd generation standard environment is limited, see Python 3.7 Local Development Server Options for new app engine apps
Adding an updated answer (in 2022)
Google App Engine supports running Python 3 Apps using dev_appserver.py (not for Windows though)
Per their documentation, ....To run dev_appserver with a Python 3 interpreter, you must specify the --runtime_python_path=[PATH_TO_PYTHON3_BINARY] flag....
Some of the bundled services (built-in APIs) like User, Memcache, Datastore, Namespace Manager are also now available for Python3 Apps. When you enable them and use dev_appserver.py to run your Python3 App, you get the same behavior you're used to in Python2 i.e. you will get a simulated datastore, memcache, users, etc

Python updates through Eclipse

How do I get Python updates through Eclipse Kepler Version?
I previously used to download it from the Google Apps Engine website, but since January 2014 Google recommended using Eclipse to get automatic updates for Python. However, when I downloaded Eclipse Kepler it did not contain Python. It only contains Java.
Eclipse has several plugins that support developing software with Python (PyDev, for example). None of those include a Python runtime and they never did. So you probably misunderstood something.
My guess is that when you say "Python", you actually mean "the app engine framework for the Python language".
As far as I can tell, you still get that from Google: https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
Now there is also a plugin for Eclipse which adds extended support for developing App Engine applications. You get that from Google as well: https://developers.google.com/eclipse/docs/getting_started

using google app engine SDK in pycharm

i'm using the PyCharm IDE, and I am trying to import webapp2 from the google app engine SDK. Since the module does not come with python, it doesn't recognize it "No module named webapp2".. I am using the pycharm community version, is there anyway around this? can I import the SDK somehow?
PyCharm Community Edition can be configured to work with Google App Engine python and hence webapp2. You won't get all the advantages of PyCharm Professional Edition such as deployment, but you'll be able to do step by step debugging and get code navigation and auto-completion working.
To enable debugging, edit the PyCharm Run/Debug configuration by setting:
Script: App Engine's dev_appserver.py
Script parameters: --automatic_restart=no --max_module_instances="default:1" .
Working directory: your base project folder (the one which contains the app.yaml file)
For more detailed instructions, explanations, and how get code completion working in your PyCharm CE project, see this tutorial.
PyCharm Community Edition does not have support for Google App Engine.
Reference: PyCharm Editions Comparison
Here's the guide which can help you to install webapp2: Quick start (to use webapp2 outside of App Engine)
Note: webapp2 is just the first step, and you will miss PyCharm integration with Google App Engine. If your project requires other Google App Engine services, consider investment into Professional version of PyCharm.
I'm using PyCharm (webApp2 library) with google app engine and I tried to found the best way for debug by python code,
that's what I found:
There is two main options:
PDB (python debugger) - GAE tool for run & debug your code which is default installed in your GAE directory (dev_appserver.py).
The tool allows you to run your program from cmd and debug it manually.
"import pdb" to your python code
use the "pdb.set_trace()" command for put a breakpoint
use cmd to run the program cd <google_appengine_dir>
python dev_appserver.py <your_project_path>
for ins cd C:\Program Files (x86)\Google\google_appengine
python dev_appserver.py C:\projects\myapp
[pbd syntax][1]
insert pdb to your python code
The second and the my preferred option is to use the pycharm build-in debugger tool. All you need to do is to use the script dev_appserver.py in the pycharm debug configuration.
Configure python GAE debugging
If you consider to upgrade to a professional version of PyCharm (or use the 30 days test-license) you can find here a guide for PyCharm showing how to create a google app engine project:
Getting Started with PyCharm as Google App Engine IDE
Before your can create the project you have to download and install the google app engine sdk depending on your platform and which language you want to use:
Download the Google App Engine SDK

How do I use the Python SDK for Google Appengine?

I normally use Java development and the Google Eclipse plugin, which integrates GoogleAppEngine deploy capability.
Now I have found a Python application with source code that I want to bring into Eclipse and deploy from Eclipse, but I don't even know if Eclipse supports Python.
What do I have to do to deploy the Python app to GAE ?
Download PyDev from its Eclipse update site.
Create a new PyDev Google App Engine Project, say using the 'Hello webapp world' template.
Set the application in app.yaml to your GAE application ID.
Right-click the src folder of your project and select Run As | PyDev:Google App Run.
Test the application works as expected in your browser.
Right-click the src folder of your project and select PyDev:Google App Engine | Upload. Follow the prompts.
Check that it works on your GAE site.
Replace the hello webapp world code with your actual application's code and retest locally, then upload again and test.
Take a look at Pydev - http://pydev.org/
I haven't used python via Eclipse at all so I'm not sure how things map to the way Eclipse deploys, but generally to deploy all you need to do is this from the command line:
appcfg.py update <app directory>
You can find more help about using Python with appengine here:
http://code.google.com/appengine/docs/python/gettingstarted/

Categories