本文介绍了为什么' pip安装mysqlclient'在Ubuntu 18.04 LTS中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在计算机上创建了一个虚拟环境(我在ubuntu 18.04 LTS上运行)。我有3.6.7的python版本,现在我想将mysqlclient安装到我的虚拟环境中。

I have just created a virtual environment on my machine (I am running on ubuntu 18.04 LTS). I have the python version of 3.6.7 and now I want to install mysqlclient into my virtual environment.

在执行 pip之后,安装mysqlclient

After I do pip install mysqlclient it didn't work, instead it gave me errors saying;

我的设置工具都是最新的。

My setup tools are all up to date.

推荐答案

mysqlclient 依赖于mysql客户端&正在安装dev软件包。为了在ubuntu上解决此问题,您必须使用 apt-get 安装几个mysql软件包。

mysqlclient has a dependency on the mysql client & dev packages being installed. In order to fix this on ubuntu, you have to use apt-get to install a couple of mysql packages.

在您的情况下,您的系统上似乎缺少了 mysql_config 。您可以通过在ubuntu仿生上安装 libmysqlclient-dev 来解决此问题。

In your case, it looks like the missing mysql_config might be missing on your system. You can fix that by installing libmysqlclient-dev on ubuntu bionic.

这篇关于为什么' pip安装mysqlclient'在Ubuntu 18.04 LTS中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:12