Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install gdal with 'pipenv install' using CFLAGS and CXXFLAGS

If I mention "gdal = '2.2.3'" in the Pipfile and launch the instruction pipenv install, the install fails.

If I launch the instruction CFLAGS="-I /usr/include/gdal" CXXFLAGS="-I /usr/include/gdal" pipenv install GDAL==2.2.3 the install succeed.

Is there a way to add the options 'CFLAGS="-I /usr/include/gdal" CXXFLAGS="-I /usr/include/gdal"' into the Pipfile so that they are taken in consideration when launching 'pipenv install'?

like image 567
jean pierre huart Avatar asked Jan 15 '20 09:01

jean pierre huart


1 Answers

Potential solution: create a .env file defining the CFLAGS etc environment variables in your project directory.

Pipenv automatically reads this file if it exists and instantiates any environment variables, when the venv is activated.

Source: https://pipenv.pypa.io/en/latest/advanced/#automatic-loading-of-env

like image 60
grisaitis Avatar answered Jan 04 '23 00:01

grisaitis