I am developing my application in google app engine now i am using Google Cloud SQL. It runs at localhost perfectly,, But when i am deploying my application to server it gives me following error.
ImportError: No module named MySQLdb
Later i have copied MySQLdb package to application directory. Now it is giving me error
ImportError: No module named _mysql.
What i am doing wrong here , Any guideline ?
MySQLdb might be missing in your app.yaml. This library should be there so that Google App Engine loads it for your instance. Hope this will help.
libraries:
- name: MySQLdb
version: "latest"
Looking at the docs that does not seem to be how you do it at all.
Building an application with a local MySQL instance
from google.appengine.api import rdbms
CLOUDSQL_INSTANCE = ''
DATABASE_NAME = 'guestbook'
USER_NAME = 'username'
PASSWORD = 'password'
def get_connection():
return rdbms.connect(instance=CLOUDSQL_INSTANCE, database=DATABASE_NAME,
user=USER_NAME, password=PASSWORD, charset='utf8')
This tutorial got my app eventually working...
What I did: I created a very basic project (just one simple app with one model) and followed above tutorial to get it working in my development environment and on GAE. Then migrated my code from my old (non-GAE) project to the new project. All was fine.
The bad news: it still takes some effort getting a new project properly deployed on GAE and Cloud SQL. I have never managed to get it working in one go. You have to really scrutinise the GAE logs.
Related
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.
I'm deployed an app to Google Cloud using this tutorial. The app is made using Flask and makes use of flask-sqlalchemy (and thus sqlalchemy).
I can load pages that don't make use of sqlalchemy fine, but pages that do raise a 500 error. The error page shows ImportError: No module named _sqlite3.
I suspect it has something to do with me trying to install a Python3 library to gcloud's Python2.7 environment, but I don't know how to fix this. Who can help me?
Have a look at Google's examples here for App Engine Standard, Cloud SQL and Python:
https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/cloud-sql
There's one for MySQL and another for PostgreSQL.
The tutorial link you shared does not appear to include a database component so I'm assuming you've evolved the example and that you're planning to use Google Cloud SQL database service for your backend.
You're likely missing a Python package that provides SQL connectivity (Google uses PyMySQL)
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.
I have created a Google app engine app which searches tweets for a specific query and stores in the GAE datastore.
To connect to twitter I am using twitter/sixohsix python library. When I tried to run the app I am getting this error:
ImportError: No module named _ssl
INFO 2013-11-10 09:09:37,112 server.py:561] default: "GET / HTTP/1.1" 500 -
I don't understand whether the problem is with the twitter library or with GAE sockets!
Note: when i type import ssl in python idle, it works fine i.e. it is able to import the module.
If the library works on the production server but not on the development server, then it's most likely a bug with the SDK as it is not emulating the production setup properly.
There is an (accepted) issue just like yours already in the bug tracker: https://code.google.com/p/googleappengine/issues/detail?id=9246&q=_ssl&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log .
I am new to google app engine, I want to create a google app engine application.
I am following this blog.
I am trying it with step by step. I am stuck with its 2nd step, where I have created conf package and relatively settings.py. I am getting ImportError: No module named django.conf error. What I am doing wrong here?
the link you read is old and may out of date.
The following document may help you config your django on newest app engine python environment.
https://developers.google.com/appengine/docs/python/cloud-sql/django?hl=zh-tw
you may need add the following lines in your app.yaml first and see if it solve the ImportError
libraries:
- name: django
version: "1.4"