1

I saw answers to a similar problem to mine but no of the answers helped me. I still have the same issue. I'm sorry if it is duplicated but the other answers do not help me.

I'm stuck with a project in Django where I have to install MySQL-python. When I'm running pip install MySQL-Python I got this error:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Ue6URf/MySQL-Python/

I used brew as suggested in some answers here but didn't help at all. I'm using a Mac machine with the last Python3 and the last Django version. I have MampPro last version which I'm using the MySQL service.

I'm sharing the entire output of the installation:

    Collecting MySQL-Python
  Downloading MySQL-python-1.2.5.zip (108kB)
    100% |################################| 112kB 561kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-build-Ue6URf/MySQL-Python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 53, in get_config
        libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
      File "setup_posix.py", line 8, in dequote
        if s[0] in "\"'" and s[0] == s[-1]:
    IndexError: string index out of range

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Ue6URf/MySQL-Python/
1
  • I saw this questions but that is not fixing my issue I still have the same issue Commented Aug 19, 2017 at 15:28

2 Answers 2

1

I resolved my issue, I resolved thanks to this post here in StackOverflow answer for PIP install fail

I had to modify my mysql_config files and do the export part describe in this answer. After that, I was able to install again doing pip install ...

Sign up to request clarification or add additional context in comments.

Comments

0

Please follow the below instructions

  1. sudo apt install libmysqlclient-dev
  2. pip install MySql-python

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.