Install GDAL and GRASS on python Web App

Dhananjay Agarwal 20 Reputation points
2025-03-13T00:59:08.62+00:00

I have developed a python script that uses GDAL and GRASS and runs fine on my local Macbook Pro. I need to make the python scripts work on the Azure Web App. For this I need to install GDAL and GRASS on the web app server. On my local machine, I am using GDAL version 3.10.2 and Grass version 8.4.0. How can I install these so my script works fine on the web-app server?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
{count} votes

Accepted answer
  1. Harshitha Veeramalla 1,301 Reputation points Microsoft External Staff Moderator
    2025-03-20T12:30:28.19+00:00

    Hi @Dhananjay

    I am able to install the GDAL 3.10.2 from the source.

    Download the GDAL 3.10.2 zip file fromlarge_image_wheels.

    I have downloaded

    GDAL-3.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl locally.

    enter image description here

    • Upload the downloaded file from KUDU using drag option.

    enter image description here

    • Navigate to SSH and run the below command.
    
     pip install ./GDAL-3.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    

    enter image description here

    As mentioned in this MSDoc you can run the commands by setting them in the startup.sh file.

    Create a startup.sh file in the application root directory. (site/wwwroot) or you can write this line directly in startup command.

    
    pip install ./GDAL-3.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    

    Grass:

    With Python runtime stack 3.12, I am able to install the Grass 8.2.0.

    I am still trying to find out the ways to install the latest Grass version.


    Hope this Helps.

    Please feel free to reach out here if you still have any other queries.


1 additional answer

Sort by: Most helpful
  1. Dhananjay Agarwal 20 Reputation points
    2025-03-25T12:34:36.0266667+00:00

    Thank you. Below is a summary.

    With python runtime stack at 3.13, I was able to install GRASS GIS version 8.2.1 using the following commands. Grass GIS installs GDAL version 3.6.2 during its installation.

    1. apt-get update
    2. apt-get install -y grass grass-dev libgdal-dev python3-gdal

    With python runtime stack at 3.10, I was able to install GDAL 3.10.2. by downloading the wheel and running the pip install command. See below.

    1. Download the wheel from https://github.com/girder/large_image_wheels/raw/wheelhouse/GDAL-3.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    2. save the file in the home/site/wwwroot folder. You can use kudu file-manager or any other ftp client.
    3. Run the following command in the SSH window of the Azure webapp. Pip install GDAL-3.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

    With this runtime stack (python 3.10), if you install GRASS GIS using the same commands listed above for Grass installation, Grass version 7.8.5. is installed.

    As you use only one Runstack, I chose python runstack 3.13 as Grass GIS version 8.2.1 was more important for me.

    Thank you, Harshitha and team. Appreciate your support.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.