Spaces:
Sleeping
Sleeping
# Update package list | |
sudo apt update | |
# Install GDAL and its development files | |
sudo apt install -y gdal-bin libgdal-dev | |
# Install Python3 development files | |
sudo apt install -y python3-dev | |
# Install GDAL Python bindings | |
sudo apt install -y python3-gdal | |
# Get GDAL version | |
GDAL_VERSION=$(gdal-config --version) | |
# Install GDAL for pip with the matching version | |
pip install GDAL | |
# Create a Python script to test the installation | |
cat << EOF > test_osgeo.py | |
import osgeo | |
print(f"OSGEO version: {osgeo.__version__}") | |
EOF | |
# Run the test script | |
python3 test_osgeo.py | |
echo "Installation complete. If you see the OSGEO version above, the installation was successful." |