question

Maria-2091 avatar image
0 Votes"
Maria-2091 asked ·

How can I install mysqlclient in my WebApp Virtual Environment without getting this error?

I am trying to install on a Linux WebApp - python 3.7 - with django

it is Linux web app with PYTHON 3.7 hosted inside a B1 App Service Plan

I am not using Docker - I am using a requirements.txt file. The deployment is successful and I can open my site.

When I use the SSH window to use my virtual environment, I run the pip install of requirements file.

This is the only item in my requirements file that doesn't install.
mysqlclient=1.4.6

I get an error saying:
error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for mysqlclient

here is the screenshot:
10233-annotation-2020-06-16-202039.png


I then changed the requirement file to includ ggc as a requirement and tried again. Again I got errors. See below screenshots:

10312-after-ggc-install-screen1.png



Just to also say that I am not using Docker. I am deploying from github, so all my dependencies are in the requirements file only. Is there any way that I can install mysqlclient in the Virtual environment using a requirements file?

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ·

Hi @Maria-2091,


In this github issue, gcc is not supported. Now what I don't know is gcc is a platform limitation or something simply missing from ML. But in reading the error message and this doc stating gunicorn is used, I'm leaning towards platform limitation. To overcome this issue, I can propose 2 options:


Add a pre-script to your app service that will install the mysqlclient library and any associate dependenices.


Use my-sql-connector, see https://docs.microsoft.com/en-us/azure/mysql/connect-python#install-python-and-the-mysql-connector, dependency instead in case mysqlclient has a dependency on gcc


Hope this helps.



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.