5

I am getting this error when I deployed my python app with Flask on Google AppEngine. I will be grateful if someone help me.

ps: My local server works like a charm

File "/base/data/home/apps/s~dwnup-997/1.385507214687998146/lib/sqlalchemy/dialects/mysql/mysqldb.py", line 92, in dbapi
    return __import__('MySQLdb')
  File "/base/data/home/apps/s~dwnup-997/1.385507214687998146/lib/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dynamic module does not define init function (init_mysql)
9
  • So you are using Google Cloud SQL? Commented Jul 5, 2015 at 20:23
  • Yes, I'm using it and the SQLAlchemy to connect to database, in my local machine I can access the data. Commented Jul 5, 2015 at 20:28
  • Have you followed all these steps: create an Google Cloud SQL instance and grant App Engine application access to it? Commented Jul 5, 2015 at 20:36
  • Yes, I followed these steps and I added this ip 0.0.0.0/0 to allow any access to database. Commented Jul 5, 2015 at 20:42
  • You should give more relevant info for someone to be able to help. Commented Jul 5, 2015 at 21:03

1 Answer 1

6

Thanks doru and Tim Hoffman,

The problem was the MySQLDb that not was at app.yaml, I deployed and shows other error.

I will open other question.

The fix is:

app.yaml

application: vuush
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: .*
  script: main.app

libraries:
- name: jinja2
  version: "2.6"
- name: markupsafe
  version: "0.15"
- name: MySQLdb
  version: "1.2.4"

requirements.txt

Flask==0.10.1
Flask-SQLAlchemy==1.0
Flask-WTF==0.9.4
Jinja2==2.7.1
MarkupSafe==0.18
MySQL-python==1.2.4
WTForms==1.0.5
Werkzeug==0.9.6
BeautifulSoup==3.2.1
requests==2.2.1
Sign up to request clarification or add additional context in comments.

4 Comments

Hey Hotaviano :) No need to put "solved" in your question title (it's actually frowned upon). You should instead accept your answer (There should be a checkmark by your answer you can click). This will mean the same thing as "SOLVED" and still follow Stack Overflow's etiquette :). Cheers!
Ooh, sorry, I will fix it.
No problem :) I just wanted to let you know, as I noticed you're a newer user. In any case, in the question list, posts with accepted answers display differently, so that's why there's no need for the "solved" note, as, once you accept ( I think you need to wait 24 hours for a self answer) it'll be visible :). Anyways, happy coding on the platform. You know of Google's issue tracker and the Google groups for the platform?
No, I will look for, this platform is awesome :). thank you for advise me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.