Python Pip 安装失败 - 无法构建 Egg。由于 google cloud sql 也无法使用 1.2.5

标签 python mysql django google-app-engine google-cloud-sql

我需要 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/

相关文章:

python - 魔术命令 %edit 应该在 iPython 中调用 IDLE

python - 使用 sublime 在终端中运行 python

PHP/MySQL 数组/numrows 交叉表

django - 无法分配 "u' 1'": "Vote.design" must be a "Design" instance

jquery - 如何从视频中提取帧并将其保存到内存中?

Python父类访问子私有(private)变量

python - 从 Pandas 中的文本时间生成 15 分钟间隔

PHP 将 utf8 Æ (195 134) 转换为 198

mysql - 使用alter table添加分区失败

将字段更改为 ManyToMany 时的 Django 数据迁移