Python GDAL: pip install --no-install GDAL fails

后端 未结 3 1152
太阳男子
太阳男子 2021-01-12 04:47

I am trying to install GDAL in virtual environment based on the various solutions out there.

However the download itself already fails:

$ pip install         


        
相关标签:
3条回答
  • 2021-01-12 05:14

    A workaround to that problem is to

    1. Download GDAL Complete from this site
    2. Install GDAL Complete.pkg
    3. Go to /Library/Frameworks/GDAL.framework/Versions/1.10/ and copy all files in there
    4. Go to your virtual environment's sites-packages /venv/lib/python2.7/site-packages and paste the copied files in there
    0 讨论(0)
  • 2021-01-12 05:33

    after install gdal using these steps on host:

    sudo apt-get install gdal-bin
    sudo apt-get install libgdal-dev
    

    After that use

    pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
    

    This should work like charm

    0 讨论(0)
  • 2021-01-12 05:34

    The workaround given by @user1738154 didn't work as expected for me so went ahead and installed GDAL using HomeBrew then using pip into my Virtual environment.

        $ brew install gdal
        (venv)$ pip install GDAL
    

    Everything compiled and ran like a charm.

    0 讨论(0)
提交回复
热议问题