Google App Engine unable to find dev_appserver.py - python

I started using Atom editor and inadvertently renamed everything in my google app engine folder from "appengine" to "google.golang.org". I switched it all back even replacing the "go_appengine" folder but I'm still getting the following error when I run my app:
goapp serve: unable to find dev_appserver.py
Thoughts?

Related

Problem facing while deploying Streamlit app

I am developing a Streamlit web app (using Python). While deploying my web app on Streamlit cloud, a strange error is shown on the screen telling me:
:exclamation: Updating the app files has failed: open /home/appuser/.ssh/id_github: no such file or directory
The log image is here:
I do not understand why it gives me this type of error when I don’t have these files or folders in my local app folder.
This happens if your GitHub SSH keys have expired. If you unlink your Streamlit Cloud account from GitHub, then re-link them, that should resolve the issue.

Google App Engine can't run dev_appserver (500/301 error & appengine.api Import Error)

My team and I are looking to deploy a python app engine project locally using dev_appserver. The application seems to be working when we deploy to GCP and access as an end user would, but when deploying via dev_appserver and python main.py, we are seeing errors in both the browser and in the terminal:
When deploying via dev_appserver, we see the following:
'Standard' 500 HTTP error in Chrome Browser:
Also see a 301 error in the command line:
When deploying via python main.py, we see the following:
Import Error: No module named appengine.api
Appreciate the time reading through this post and hope to get this resolved as everything else I've read on other SO posts/forums elsewhere has not provided any help.
Thanks all.

Pandas failing to install when deploying Dash app to Azure

I'm getting the following error message when trying to deploy my Dash app to Azure:
Error
It then cleans up and says that "Command pyton setup.py egg_info failed with error code 1 in D:\home\site\wwwroot\env\build\Pandas"
What am I doing wrong here? Is there an issue with Pandas?
Funnily enough I ran into the exact same issue for a web app that I am working on at the moment. After 5 days of trying endless solutions I have eventually managed to get my app to deploy to Azure. My app is a Flask web app but the process is pretty much the same (if you are using Django or Dash in your case) or anything else. I am providing my answer based on the most useful links that solved my issue (I checked far too many, but these did the trick!).
This seems to be a known issue with Azure and is to do with Python version and package compatability. The first thing to check here will be the version of python you are using - if you have created your virtual environment in a version of python which is > 3.4 then you will need to install the Azure Python extension. This can be found on the left hand pane of your App Service resource under the category 'Development Tools' -> 'Extensions'. Currently the latest Python extension you can install is version 3.6.4. I had to install this as I was using python 3.6.5 for my web app:
I used the following answer by Konrad Lyda to help me solve my issue : Using python 3.6 on azure app services - not working despite it is installed as extension. You will have to manually install your packages using the kudu console and by adding a .skipPythonDeployment file. This is all explained in the link. I managed to replicate the same WSGI_HANDLER Error as highlighted and some further research led me to this link: https://github.com/Cojacfar/FlaskWeb . I know this link is Flask specific but the project structure should really help. You will need to add a web.config file to your project (just take the code from the web.config file in the git project) and replace the 'WSGI_HANDLER' value to the name of your app file. My app was defined in my views.py file so the value I used was 'views.app'.
The line that did it for me was:
wsgi_app = app.wsgi_app
which goes under your app declaration. For example, as I was using Flask and Flask boostrap I have the following in my app file:
app = Flask(__name__)
bootstrap = Bootstrap(app)
wsgi_app = app.wsgi_app
Once I got all my code in place I removed any unnecessary files that I did not need and deployed to Azure and it started working!
Let me know you get on. Hope this helps.

starting with google app engine on ubuntu

I'm trying to write my first google app engine sample, with django.
I followed:
https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
and then:
https://console.developers.google.com/start/appengine?_ga=1.115566598.1847531954.1430589011
but I was unable to run it:
when I'm trying to run the sample locally (python manage.py runserver 0.0.0.0:8000)
I'm getting: ImportError: No module named google3.storage.onestore.v3
any idea?
Thanks!
You're attempting to run the Django development server, not the App Engine development server. You need to be running the latter so that import paths can be adjusted.

Python App Engine SDK only loads default module

I have an App Engine app contains 3 modules and a dispatch.yaml. It works perfectly in production, however on the dev server (using GAE Launcher) only the default module is loaded.
The command which is run by the launcher:
Running command: "['D:\\Python27\\pythonw.exe', 'D:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=10081', '--admin_port=8002', 'D:\\path\\to\\my\\app']"
I know that when running dev_appserver.py using the command line it is possible to specify all modules as arguments. Is there a way of doing it when using the Launcher?
I believe this is done the same way as you do for an IDE like PyCharm, where you pass the yaml files (for each module) in the Extra Flags section.
Double-click the instance in App Engine Launcher
Under Extra Flags, add all the yaml files for your modules, separated by a space "app.yaml app2.yaml app3.yaml"
Bardia's answer is correct. However, after experiencing the problem myself and speaking with a GAE support engineer, I've added some further details. This information is currently missing from the official GAE documentation, but Google are planning to add it soon.
To use Google App Engine Launcher to 'Run' or 'Deploy' an application that uses modules you first need to:
Double click the application in Google App Engine Launcher, to bring up the Application Settings window.
Under Extra Flags, list the yaml files separated by spaces. Specify the full file path. If you are using a routing file, dispatch.yaml, list it first. Don't include app.yaml as this is already included by default.
e.g. /Users/.../dispatch.yaml /Users/.../app2.yaml /Users/.../app3.yaml
There is also a blog post, which explains how to do it, here:
http://www.shiftedup.com/2014/11/11/running-modules-locally-using-the-googleappenginelauncher-application
Update
Yaron commented that this method only works when you click the 'Run' button to run on localhost, but it doesn't work when you click 'Deploy' to deploy to production. I checked and I had the same problem, so I contacted Google support. They advised me that Google App Engine Launcher is now archived and is no longer supported. Instead we should use the new 'gcloud preview app deploy' command.
To deploy multiple modules, type the following into the command line:
gcloud preview app deploy ~/my_app/app.yaml \
~/my_app/another_module.yaml
Which is a shame, because I quite liked Google App Engine Launcher.

Categories

Resources