GAE Python - No module named MySQLdb

2019-09-14 16:07发布

Recently I switched to "vm: true" on my app.yaml. Since then I'm having some issues regarding the MySQLdb library.

I'm trying to import MySQL like this:

import MySQLdb

My requirements.txt looks like this:

MySQL-python==1.2.5  

I figured that I wasn't supposed to use "libraries" inside my app.yaml and should put all my dependencies on the "requirements.txt".

I uploaded several times with/without this file but this error is thrown:

No module named MySQLdb

It works fine locally.

Anyone had this issue?

Thanks.

1条回答
\"骚年 ilove
2楼-- · 2019-09-14 16:34

You should use the following command to deploy:

gcloud preview app deploy

Take a look here for more details.

Also, here there is a official example of your use case. I can see a little difference, the author is using PyMySQL==0.7.3 instead of MySQL-python.

查看更多
登录 后发表回答