I m starting to build python application in windows platform using google appengine
whats the steps to debug and run my application
On Windows I use Aptana.
Once you've installed that, run it, go to the Plugins tab and get Pydev.
Pydev has inbuilt support for google app engine - so you can create an app engine project, and then run or debug it. See these posts for more details:
http://pydev.blogspot.com/2009/05/testing-on-pydev-146-google-app-engine.html
http://pydev.blogspot.com/2009/05/pydev-146-released-google-app-engine-on.html
Related
I have a nodeJS API which uses child_process to run a python file.
I know heroku has a way to add another buildpack with a script.
Is there a way with Microsoft Azure (web app / app services) to use NodeAPI and Python files in an App service.
PS : Python file is not an API, it is just a script that runs from node.
Thank you
When you hosted a Web App in Azure, you already have all runtime environments by default.
Web App Runtime on Azure Portal:
Python Runtime on Kudu Explorer:
NodeJS and PHP on Kudu Explorer:
Check the other stack versions in Console and if it not sufficient, update them.
Note:
When creating the webapp, it is recommended to choose windows platform which supports virtual application because when you find that you cannot use the runtime you required, you can try to install runtime extensions for other programs.
Also, it is possible under Linux but requires command line to operate.
I adapted the quick start code Python version here for Azure text to speech.
The app runs correctly on my local server. However, when I deploy the app through Visual Studio Code to Azure App Services, I got the error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND).
I found that this error is the same as the posts here and here. The reason seems to be that the Python interpreter used was from Microsoft Store instead of from Python.org. The solution, therefore, seems to be switching from the Microsoft Store version of Python to the Python.org version of python.
However, the solution above seems only work for those apps that run on a local or remote server. Since I am deploying my app to Azure App Services, and the deployment builds everything remote using oryx, I don't know how to switch from Microsoft Store version Python to the Python.org version python remotely.
I tried to change the Azure App Services Python version using Powershell, following the instruction from this post, but I was only able to change it from the current version of Python 3.9 to Python 3.8. When trying to change to version 3.10, I got an error message saying Python 3.10 is not supported.
After changing to Python 3.8, a new error was given:
ModuleNotFoundError at /
No module named '_speech_py_impl'
Thanks to #RajkumarMamidiChettu-MT for the instruction in the answer below. I think the solution is at the right direction. However, I got stuck at Step 3: My Azure app resource group is Linux (this seems to be default for Python apps and I can't change it). Therefore my kudu site does not have the UI of Debug Console and I cannot drag and drop my local Python package to the server. I do see that I have SSH and BASH interface. However, I don't know how and where to upload the package with either SSH or Bash.
Hopefully, someone can point me to the right direction. I feel I am getting so close.
For what it's worth, I found the Azure Text to Speech Error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) error in my situation is because the deployment process was looking for the Linux version of Azure-Congnitiveservices-speech library, which ends with .so. However, for whatever reason, those .so library files were not generated when deploying my app to the Azure Linux environment. And the method mentioned in another post Azure Speech to text 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) of manually pasting .dll (library files in windows) files to the execution path didn't work, because the web app environment is Linux, which is the default environment by Azure App Services for the Python web app. And there is no way to change the web app environment from Linux to Windows if using Azure's preconfigured web app environment to deploy a python app.
I was not able to figure out how to generate .so files for the Azure-Congnitiveservices-Speech pack with the default Linux environment. So I end up creating a custom Docker Windows Server container with Python 3.10, WindowsServer2019 (python:3.10.4-windowsservercore-1809 2022 is not supported at the time of this post), and then deploying it to Azure App Services with the customer docker container. It is working now.
I can't seem to be able to add the Google App Engine Python runtime on IntelliJ. I tried to add an additional Python SDK and configure my project to use that, but I can't find the correct Python runtime to point to.
Note that I'm not interested in using the PyCharm IDE, and want to maintain the polyglot IntelliJ IDE setup.
My setup:
IntelliJ Ultimate 13.1
Python plugin
Google App Engine Plugin
Google Cloud SDK
Relevant links:
https://cloud.google.com/sdk/
http://plugins.jetbrains.com/plugin/?id=631
https://www.jetbrains.com/pycharm/quickstart/appengine_guide.html
You probably solve this task and find right approach for you.
I'll just add my solution for this task for IntelliJ 2016 and later, probably earlier version too.
At first, I advise you to crate virtualenv. And install gcloud and Google App Engine itself using cloud toolkit.
Next, open in IDE your project by selecting proper folder.
Go to File > Project structure (Mac) and in Project Settings section > Project, in Project SDK drop-down choose /or set your newly crated virtualenv.
After that, go to Modules in the same section, and hit + sign. Choose New Module from context menu. Go to Python section, and there mark Google App Engine (Python) checkbox. Set your Application ID in proper field beneath checkbox list, and choose path to Google App Engine SDK. If you set SDK trough gcloud toolset, you can get right path by using gcloud info command in console by your favour. Path that you are looking for is Installation Root and add /platform/google_appengine to it.
Congratulations. You are good to go!
I'm getting this error when I attempt to deploy my python project for the first time. I could have sworn that I set everything up correctly. Is there something I need to set in the configuration? I have not idea where to start looking, any help would be appreciated.
This is my app.yaml file. It resides in the src folder:
application: bsl-dm
version: 1
runtime: python
api_version: 1
EDIT: After looking into this, I think the solution is that you cannot do this for python through eclipse (only java). You instead have to use the separate "Google App Engine Launcher" application.
I got your problem. I think you are using google plugin to deploy the app which expects an java application. It won't work for python applications. To deploy python app engine app from eclipse use pydev plugin. A search on google will get you there
This got me too! I assumed the button in the toolbar could be used for Python too but it was only for java.
In eclipse(which im guessing its the same in Aptana) once you have the pydev plugin installed simply right click on your apps main folder and go to "PyDev: Google App Engine" and click 'Upload'
You have a register a unique application id in appengine.google.com for your account inorder to deploy the same.You will see something like this where you have to choose a id and register it. Make sure you have mentioned the same in your app.yaml.
Have you reserved that app-id at https://appengine.google.com/ ?
How do I get Eclipse to load the Google python SDK?
I am using OSX 10.6, I have Eclipse (helios) and I have downloaded the GoogleAppEngineLauncher and the Eclipse plugin.
When I try to start a new web app project its asks for the SDK. I enter my location as follows:
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine
But all I get is Failed to initialize!
What I have Done wrong? any suggestions?
You shouldn't need to install the Google App Engine SDK/Launcher separately if using Eclipse. The Google Plugin for Eclipse will install the App Engine SDK/Launcher for you:
http://code.google.com/eclipse/
In the event you need to install them separately, it does appear you've got a space in your path between "Resources" and "GoogleApeEngine-default.bundle". Also, have you verified the path in question, the path to google_appenine, is valid?