Unable to install mysqlclient on centos

前端 未结 5 2139
别跟我提以往
别跟我提以往 2021-01-14 05:36

I am building a django app and for which i need to configure mysql.I am trying to install mysqlclient module for sql connection and this is what i am trying

         


        
5条回答
  •  误落风尘
    2021-01-14 06:30

    It's complaining about not being able to find mariadb libs. Run the following to find out why:

    ld -lmariadb --verbose
    

    This should tell you specifically what gcc is missing.

    My guess is that you are missing some MySQL development headers. Install them with:

    debian / ubuntu: sudo apt-get install python-dev libmysqlclient-dev
    redhat / centos: sudo yum install python-devel mysql-devel
    

    Update: It really is missing MariaDB shared libs. I think on CentOS, this should take care of it:

    sudo yum install MariaDB-devel
    

    Final Update: Just use PyMySQL - pure python, no headers required, no need to jump through these kinds of hoops.

提交回复
热议问题