1

I have tried yum install MYSQL-python, pip install MySQL-python and easy_install MySQL-python.

Get this error: 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)

yum install worked and it said: Package MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 already installed and latest version.

But when i open python and type : import MySQLdb it says ImportError: No module named mysqldb

Even tried manually installing gcc via yum install gcc or yum install python-devel...all didnt work.

2 Answers 2

0

Set your terminal encoding to UTF-8, run following in terminal:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
Sign up to request clarification or add additional context in comments.

2 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
@GerarddeVisser is it okay now?
0

found the answer: yum install mysql-devel.x86_64

Seems like yum install mysql-devel didnt do it. Had to be more specific..

Install mysql-python return error in CentOs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.