Unix系统安装MySQL-python出现UnicodeDecodeError错误解决方法

时间:2023-03-09 17:15:14
Unix系统安装MySQL-python出现UnicodeDecodeError错误解决方法

今天装MySQL-python时候出现了这个错误:

    error: command 'gcc' failed with exit status   

    ----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-TIlEQj-record/install-record.txt --single-version-externally-managed failed with error code in /tmp/pip_build_root/MySQL-python
Traceback (most recent call last):
File "/usr/bin/pip", line , in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/usr/lib/python2.6/site-packages/pip/__init__.py", line , in main
return command.main(args[:], options)
File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line , in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)

经过搜索之后找到了解决办法,就是先安装Python-devel,然后再安装MySQL-python就可以了。