我需要 mysql-python。
安装 1.2.4 时出现无法构建 Egg 的错误 到处都说安装 1.2.5,这也适用于我。
但是googleAppEngine的app.yaml仅支持1.2.4
libraries:
- name: MySQLdb
version: "1.2.4"
因此,如果我在那里使用 1.2.4,并在虚拟环境中使用 1.2.5,则会收到错误 -
ImproperlyConfigured: Error loading MySQLdb module: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 2, 4, 'final', 1)
1:1430668397.857531 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.
应该做什么,无论是使用 App Engine 还是使用 1.2.4 pip 都可以!
最佳答案
运行 -
pip 卸载 mysql-python
YAML -
libraries:
- name: MySQLdb
version: "1.2.4"
设置 -
'default': {
'ENGINE':'django.db.backends.mysql',
'HOST':'/cloudsql/ProjectName:DBName',
'NAME': 'my_database',
'USER': 'root',
'PASSWORD': '********',
}
关于Python Pip 安装失败 - 无法构建 Egg。由于 google cloud sql 也无法使用 1.2.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30015930/