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)
Avinash Raj
  • 172,303
  • 28
  • 230
  • 274

1 Answers1

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
  • 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! – Patrice Jul 06 '15 at 20:26
  • Ooh, sorry, I will fix it. – Hotaviano Melo Jul 06 '15 at 21:28
  • 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? – Patrice Jul 06 '15 at 21:33
  • No, I will look for, this platform is awesome :). thank you for advise me – Hotaviano Melo Jul 06 '15 at 22:46