简体   繁体   English

无法在python virtualenv中安装mysqlclient

[英]Failing to install mysqlclient in python virtualenv

I am trying to create a website using Django and would like to use mySQL. 我正在尝试使用Django创建一个网站,并希望使用mySQL。 Thus, with the virtualenv activated, I'm using the following command : 因此,在激活virtualenv的情况下,我使用以下命令:

pip install mysqlclient

This input gives the following error : 此输入产生以下错误:

_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

The thing is installing it on my local python version worked like a charm ,I only face this error inside virtualenv. 事情是将其安装在我的本地python版本上就像一个魅力,我只在virtualenv内部遇到此错误。

I'm using python 3.7, pip and setuptools are up to date. 我正在使用python 3.7,pip和setuptools是最新的。 The mysqlclient version installed locally is 1.3.13. 本地安装的mysqlclient版本是1.3.13。

You can try these things for windows 64-bit: 您可以在Windows 64位上尝试以下操作:

If 64 bits versions are not working you can alternatively use the 32 bits versions : 如果64位版本不起作用,则可以选择使用32位版本:

For python 3.x: 对于python 3.x:

pip install mysqlclient‑1.3.13‑cp37‑cp37m‑win32.whl

For python 2.7: 对于python 2.7:

pip install mysqlclient‑1.3.13‑cp27‑cp27m‑win32.whl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM