Django:Mysql-python安装错误

 李瑶626 发布于 2023-01-30 11:47

当尝试为Django安装requirements.txt时,我在尝试安装Mysql-python时遇到以下错误

Traceback (most recent call last):

  File "", line 17, in 

  File "/home/abercrrl/.virtualenvs/django_at/build/MySQL-python/setup.py", line 7, in 

    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

1 个回答
  • 你必须安装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或/sf/ask/17360801/

    2023-01-30 11:50 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有