代码之家  ›  专栏  ›  技术社区  ›  spraff

`pip-install-mysqlclient“失败,因为”pkg config--exists-mysqlclient“失败

  •  0
  • spraff  · 技术社区  · 2 年前

    我正在努力 pip install mysqlclient 在Ubuntu 22.04上,但是

    Collecting mysqlclient
      Using cached mysqlclient-2.2.0.tar.gz (89 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [24 lines of output]
          /bin/sh: 1: pkg-config: not found
          /bin/sh: 1: pkg-config: not found
          Trying pkg-config --exists mysqlclient
          Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
          Trying pkg-config --exists mariadb
    

    根据上的评论 this question 我做到了

    apt-get -y install python3-dev gcc build-essential libmysqlclient-dev
    

    注意 ls /usr/include/mysql/ ls /usr/lib/x86_64-linux-gnu/libmysqlclient.* 显示libmysqlclient已经安装,mysql头已经就位。

    还缺少什么?

    0 回复  |  直到 2 年前
    推荐文章