【发布时间】:2014-02-23 13:05:55
【问题描述】:
尝试为 Django 安装 requirements.txt 时,尝试安装 Mysql-python 时出现以下错误
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/abercrrl/.virtualenvs/django_at/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 /home/abercrrl/.virtualenvs/django_at/build/MySQL-python
Storing debug log for failure in /home/abercrrl/.pip/pip.log
请注意,我已经尝试过:
pip install --upgrade setuptools
Setuptools 已经是最新的
编辑:
我修改了以下命令以匹配我的位置:
echo "mysql_config = /usr/bin/mysql_config" >> ~/.virtualenvs/django_at/build/MySQL-python/site.cfg
我确实必须创建 build 和 MySQL-python 目录才能使其正常工作。该命令运行良好,但是现在我得到了这个: https://gist.github.com/rlabercrombie/8725074
【问题讨论】:
-
您应该提供更多信息,然后粘贴文件 /home/abercrrl/.pip/pip.log。你试过手动做
pip install MySQL-python吗? -
This answer 已解决该问题。
-
@caesarsol 整个文件太大,无法在此处发布。有没有发布大量代码的好方法?手动 pip install MySQL-python 产生同样的错误
-
@richard008:用户 matagus 给了你我认为正确的答案。下次粘贴日志文件的最后几行,或者粘贴到gist.github.com或者pastebin.com
-
@caesarsol 我更新了我的帖子,但出现了另一个错误。
标签: python django mysql-python