Nasta
Nasta

Reputation: 929

Failing to install mysqlclient in python virtualenv

I am trying to create a website using Django and would like to use mySQL. Thus, with the virtualenv activated, I'm using the following command :

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.

I'm using python 3.7, pip and setuptools are up to date. The mysqlclient version installed locally is 1.3.13.

Upvotes: 1

Views: 5177

Answers (1)

Agile_Eagle
Agile_Eagle

Reputation: 1839

You can try these things for windows 64-bit:

If 64 bits versions are not working you can alternatively use the 32 bits versions :

For python 3.x:

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

For python 2.7:

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

Upvotes: 5

Related Questions