【问题标题】:Error when trying to install Django CMS in virtualenv w/ MySQL on Mac OSX尝试在 Mac OSX 上的带有 MySQL 的 virtualenv 中安装 Django CMS 时出错
【发布时间】:2014-02-07 13:11:41
【问题描述】:

当我尝试使用 virutalenv 安装带有 MySQL 的 django CMS 时出现以下错误:

RuntimeError: maximum recursion depth exceeded

/Users/ethan/Sites/env/build/mysql-python/distribute-0.6.28-py2.7.egg

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/Users/ethan/Sites/env/build/mysql-python/setup.py", line 7, in <module>

    use_setuptools()

  File "distribute_setup.py", line 145, in use_setuptools

    return _do_download(version, download_base, to_dir, download_delay)

  File "distribute_setup.py", line 125, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "distribute_setup.py", line 116, in _build_egg

    raise IOError('Could not build the egg.')

IOError: Could not build the egg.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/ethan/Sites/env/build/mysql-python

我用于安装的命令如下:

env/bin/pip install --download-cache=~/.pip-cache -r reqs.txt

reqs.txt 文件如下所示:

django-cms==2.4.1  
Django==1.5.1  
django-classy-tags==0.4  
South==0.8.1  
html5lib==1.0b1  
django-mptt==0.5.2  
django-sekizai==0.7  
six==1.3.0  
Pillow==2.0.0  
django-filer==0.9.4  
cmsplugin-filer==0.9.5  
django-reversion==1.7  
mysql-python==1.2.4  

我是 django 的新手(只是通过教程),我在搜索中找不到任何似乎可以解决此问题的内容。谁有想法?

【问题讨论】:

  • 当您尝试运行“pip install -r reqs.txt”时您的 virtualenv 是否处于活动状态?
  • 你的意思是激活,我是否运行了source env/bin/activate 命令?如果是这样,是的。
  • 我在 virtualenv 活动的情况下尝试了它,即在运行上述命令之后,然后在运行 source ~/.bash_profile 之后再次尝试。同样的错误。这可能与找不到我的mysql安装有关吗?
  • 大多数 Django 开发人员使用 Postgres SQL。我建议使用 Postgres,因为我从来没有遇到过这个问题。我不确定 MySQL 是否与 VirtualEnv 冲突。
  • @AronYsidoro,好吧,我接受了你的建议,并且奏效了。猜猜mysql链接有问题?

标签: mysql django macos


【解决方案1】:

将您的要求更改为 mysql-python==1.2.5,我在 CentOS 6.3 服务器上遇到了同样的问题。

【讨论】:

    【解决方案2】:

    mysql-python v. 1.2.4 对分发版本 0.6.28 有硬依赖。它可能没有选择正确的分发版本。

    在虚拟环境激活后运行:

    easy_install distribute==0.6.28
    

    你应该很好地继续

    env/bin/pip install --download-cache=~/.pip-cache -r reqs.txt
    

    【讨论】:

      【解决方案3】:

      对 mysql-python==1.2.5 的更改要求也适用于我在 OS X mavericks 上使用 pip install

      【讨论】:

        猜你喜欢
        • 2015-09-06
        • 2012-02-22
        • 1970-01-01
        • 2013-11-30
        • 1970-01-01
        • 1970-01-01
        • 2020-01-19
        • 2020-03-01
        • 1970-01-01
        相关资源
        最近更新 更多