ImportError: No module named 'ConfigParser' in Python

Dung Do Tien Dec 25 2021 827

Hello Guys, I'm just studying Python one month before and I practiced with the MySql database to store data for me.

When I try to run command pip install MySQL-python on CentOs Ubuntu but I got an exception ImportError: No module named 'ConfigParser'.

 File "/var/folders/lf/asdaklfhnasndasbdhsabd_3e4332w/T/pip-build/MySQL-python/", line 14, in <module>

from setup_posix import get_config

File "./", line 2, in <module>

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

I'm using Python 3.9 and running on CentOs.

Do you have any suggestions for me?

Thank you so much.

Have 3 answer(s) found.
  • V

    Vien Pham Dec 25 2021

    I try to run command

     sudo python3 -m pip install mysql-connector

    And it worked for me.

  • N

    Nguyen Quoc Viet Dec 25 2021

    1. yum install python39-devel.x86_64
    2. yum groupinstall -y 'development tools'
    3. pip3 install mysql-connector
    4. pip install mysqlclient

    You can run step by step above and try again. I hope it helpful for you.

  • m

    mino Dec 25 2021

    Oh, MySQL-python does not currently support Python 3. 

    You can try install MySql by using command pip install mysqlclient

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close