所以我试图用python设置MySQL。我跑
sudo easy_install mysql-python
一切顺利,直到我遇到这个障碍:
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Reading http://sourceforge.net/projects/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.3
Downloading http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-n6N62W/MySQL-python-1.2.3/egg-dist-tmp-PnGsWS
sh: mysql_config: command not found
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1712, in main
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 211, in run
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/easy_install-n6N62W/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
File "/tmp/easy_install-n6N62W/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
EnvironmentError: mysql_config not found
但是,我做了一个
export MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
当我做一个printenv时它似乎就在那里。这个错误有什么问题,我该如何解决?
答案 0 :(得分:0)
要轻松回答这个问题,请看看我最终在这里做了什么:
MySQL-python, error: command 'gcc-4.2' failed with exit status 1
这有点问题。不知道easy_install究竟是什么问题。