I did a bunch of research on this and could not find an answer to my specific problem, although it seems allot of people have been plagued with similar problems.
I am new to Google App Engine and just created an account. I downloaded the SDK for Python 2.7. I deployed the Hello, World! to the supplied appspot.com address and it prints hello world just fine. When I try to run it in my localhost it gives a 500 server error.
I tried creating a few different applications and messing with the port settings, the app.yaml file, and the main.py file. Still cant get it to work.
Im running on an Mac and I did download and install Python 2.7 to ensure I have the latest version. Im also new to Python and App Engine. I come from the world of PHP and XAMPP.
Does anybody have any ideas?
You should try Python 2.7.4 which is the version Google links to and run a PHP version compiled with the same modules and option that GAE as well.
Here's a video with the steps
http://www.youtube.com/watch?v=IFuNNddWQIo
Related
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'm trying to create a webservice using webapp2 and datastore in python. But whenever i try to run "dev_appserver.py app.yaml" it throws me the following error
ERROR 2017-10-11 05:44:16,207 instance.py:280] Cannot connect to the instance on localhost:17514
But when i ran the same program using mac it working perfectly fine. Is I'm missing something here, Please find the screeenshot of components i have installed in gcloud.
Could somebody tell what i'm doing wrong here? I'm newbie to google cloud platform, if i am doing something wrong kindly point me to right direction. Any help would be appreciated. Thank you.
I see the same errors when trying to execute the dev_appserver.py from the Cloud SDK version 174.0.0.
However the dev_appserver.py from the standalone GAE SDK version 1.9.61 (theoretically the same being packed into the gcloud SDK 174.0.0) is running fine.
So one possible workaround to try would be to also install the standalone GAE SDK and run that dev_appserver.py instead.
Note: this is on linux, though, YMMV.
Related: What is the relationship between Google's App Engine SDK and Cloud SDK?
The problem is fixed. Like #DanCornilescu said it's an environment issue. I deactivated the virtual environment. And It works fine with no issue.
Solution for macOS. Maybe it works on Linux and Windows:
Find and remove folder:
appengine.None.<USER_NAME>
from the:
/var/folders
In may case:
/var/folders/6w/v0865mm96rj85dlwnr311bt00000gn/T/appengine.None.<USER_NAME>
I'm refactoring some of my old golang applications and I ran into this problem. I'd oversimplified the spin-up of my web server not realizing this is a critical block of code:
// Critical to work on AppEngine
port := os.Getenv("PORT")
if port == "" {
port = "8080"
log.Printf("Defaulting to port %s", port)
}
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), r))
Hope this helps.
I have been getting into programming and I would love it if my friends and I could program python (Client Side as in I could run it on my computer offline(Saying it is an offline application)) in cloud 9 IDE (If you don't know you can work real time with your team in the IDE). The problem is it will run it as if I am using it as a web language. Also DJANGO just gets in the way.
Any way I can launch it as an application?
You need not install Django on Cloud9. You've got the option to install a blank container. From there you can pip install anything like. Write your .py file and then python run myfile.py -- Link to Cloud9 Docs
While not as slick as Cloud9 Python Anywhere which is more focussed on Python Apps.
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?
I'm trying to get django running on my dreahost account. I've been trying to sort of use two tutorials at once: the one on the dreamhost wiki and the one in the django book.
I installed django using the script on the wiki page, but I ran into trouble immediately while trying to work through the django book. It says:
To start the server, change into your project directory (cd mysite), if you haven’t already, and run this command:
python manage.py runserver
This launches the server locally, on port 8000, accessible only to connections from your own computer. Now that it’s running, visit 127.0.0.1:8000 with your Web browser. You’ll see a “Welcome to Django” page shaded in a pleasant pastel blue. It worked!
Those instructions seem to assume that you're developing locally, not on a shared server. Where the heck am I supposed to look for the "Welcome to Django" page after starting the server? In my webroot? No dice.
Anyway, I tried to blunder ahead through the django book to its hello world tutorial (chapter 3). But once I've edited the view file and the URLconf, I don't get a nice clean "hello world" text. Instead (as you can see) I get an "import error".
Any help would be greatly appreciated.
Don't try and learn Django via your server. Install it on your local computer, learn how it works, develop your project, and then install it on Dreamhost.
Your project assumes that 1) your app is called "mysite", and 2) mysite is a package, e.g. mysite/__init__.py exists. If either of those are false then correct your code and/or file structure.
This is an old post and am sure you have found the answer by now. I have solved this problem by using the command
python manage.py runserver mydomain.com:8080