2014-10-07 99 views
1

我試過yum install MYSQL-python,pip安裝MySQL-python和easy_install MySQL-python。錯誤在RHEL上安裝MySQL-python 6

得到這個錯誤:error: command 'gcc' failed with exit status 1

Cleaning up... 
Command /usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rpOkcR-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/MySQL-python 
Traceback (most recent call last): 
    File "/usr/local/bin/pip", line 8, in <module> 
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() 
    File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 185, in main 
    return command.main(cmd_args) 
    File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 161, in main 
    text = '\n'.join(complete_log) 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal not in range(128) 

百勝安裝工作,它說:Package MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 already installed and latest version.

但是當我打開Python和類型:進口MySQLdb的,它說ImportError: No module named mysqldb

偶試過手動安裝GCC通過yum安裝gcc或yum安裝python-devel ...所有都沒有工作。

回答

0

設置終端編碼UTF-8,運行以下端子:

export LC_ALL=en_US.UTF-8 
export LANG=en_US.UTF-8 
export LANGUAGE=en_US.UTF-8 
+1

這並不提供答案的問題。要批評或要求作者澄清,請在其帖子下方留言。 – 2014-10-07 07:34:26

+1

@GerarddeVisser現在好嗎? – avi 2014-10-07 07:37:11