Django:Mysqlpython安装

2024-06-20 11:37:38 发布

您现在位置:Python中文网/ 问答频道 /正文

当尝试为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


Tags: djangoinpybuildhomeeggdownloadsetup