Google AppEngine ImportError: dynamic module does

2019-06-27 06:52发布

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)

1条回答
Explosion°爆炸
2楼-- · 2019-06-27 07:46

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
查看更多
登录 后发表回答