9
# pip3.4 install mysql-python
  Downloading/unpacking mysql-python
  Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
  Running setup.py (path:/tmp/pip_build_root/mysql-python/setup.py) egg_info for package mysql-python
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>
        from setup_posix import get_config
      File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>
        from ConfigParser import SafeConfigParser
    ImportError: No module named 'ConfigParser'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>

    from setup_posix import get_config

  File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>

    from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/mysql-python
Storing debug log for failure in /root/.pip/pip.log
3
  • are you trying to install a package for python 2 in python 3? I think that package is for python < 3.0 Commented Jan 2, 2015 at 21:11
  • MySQL-python does not support Python 3. Commented Jan 2, 2015 at 21:14
  • try sudo apt-get install mysql-client Commented Jan 2, 2015 at 21:22

4 Answers 4

19

MySQL-python 1.2.5 does not support Python 3. The Django 1.7 docs recommend the fork mysqlclient.

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

Comments

7

Resolved:

 pip3.4 install --allow-external mysql-connector-python 

Edit settings.py

'ENGINE': 'mysql.connector.django',

4 Comments

I've seen questions from users struggling to get MySQL connector to work. The Django docs recommend mysqlclient.
where you able to install mysql-python after that?
this answer doesnt help me. the answer posted by Alasdair below helped.
DEPRECATION: --allow-external has been deprecated and will be removed in the future. Due to changes in the repository pr otocol, it no longer has any effect.
0

Under Centos: yum install mysql-devel pip3 install mysqlclient

Comments

-4

On Ubuntu or Debian, just sudo apt-get install python-mysqldb. It worked for me

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.