Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google AppEngine ImportError: dynamic module does not define init function (init_mysql)

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)
like image 380
Hotaviano Melo Avatar asked Jul 05 '15 20:07

Hotaviano Melo


1 Answers

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
like image 50
Hotaviano Melo Avatar answered Oct 31 '22 13:10

Hotaviano Melo