在尝试为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我确实需要创建构建和MySQL-python目录才能工作。这个命令运行得很好,但是现在我得到了这个命令:https://gist.github.com/rlabercrombie/8725074
发布于 2014-01-31 01:50:10
您必须安装mysql dev和所有必需的库,以便构建mysql-python:sudo apt-get install build-essential python-dev libmysqlclient-dev python-mysqldb。详见http://mysql-python.blogspot.no/2012/11/is-mysqldb-hard-to-install.html或https://stackoverflow.com/a/7461662/3219121
https://stackoverflow.com/questions/21469872
复制相似问题