MySQL-Python安装 – 无法构建鸡蛋

前端之家收集整理的这篇文章主要介绍了MySQL-Python安装 – 无法构建鸡蛋前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试设置python MysqL.我正在完成以下教程:

http://anthonyscherba.com/site/blog/django-mysql-install-mac

我很好,直到第5集.当我跑

$python setup.py clean

我得到了回报

 /Users/msmith/Downloads/MysqL-python-1.2.4b4/distribute-0.6.28-py2.7.egg
 Traceback (most recent call last):
 File "setup.py",line 7,in MysqL-python-1.2.4b4/distribute_setup.py",line 145,in use_setuptools
    return _do_download(version,download_base,to_dir,download_delay)
  File "/Users/msmith/Downloads/MysqL-python-1.2.4b4/distribute_setup.py",line 125,in _do_download
    _build_egg(egg,tarball,to_dir)
  File "/Users/msmith/Downloads/MysqL-python-1.2.4b4/distribute_setup.py",line 116,in _build_egg
    raise IOError('Could not build the egg.')
IOError: Could not build the egg.
最佳答案
我已经成功遵循这些提示

首先尝试使用pip进行安装:

pip install MysqL-python

然后:(从这里:Django Error: vertualenv EnvironmentError: mysql_config not found)

echo "MysqL_config = /usr/local/MysqL/bin/MysqL_config" >> ~/.virtualenvs/ENV_NAME/build/MysqL-python/site.cfg

然后,(从这里:cc1: error: unrecognized command line option “-Wno-null-conversion” within installing python-mysql on mac 10.7.5)

“尝试删除cflags -Wno-null-conversion -Wno-unused-private-field [from] /usr/local/MysqL / bin / MysqL_config.”

然后,再次安装:
    pip install MysqL-python

然后(从这里:Python mysqldb: Library not loaded: libmysqlclient.18.dylib)

sudo ln -s /usr/local/MysqL/lib/libMysqLclient.18.dylib /usr/lib/libMysqLclient.18.dylib

那它应该工作!

猜你在找的MySQL相关文章