问题描述
我刚刚在计算机上创建了一个虚拟环境(我在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 install mysqlclient'在ubuntu 18.04 LTS中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!