赞
踩
1.不用手动下载文件,直接执行以下命令即可
conda install gdal
2.首先,下载gdal的whl文件 链接, 官网下载比较慢,GDAL-2.2.4-cp27-cp27m-win_amd64.whl
链接: https://pan.baidu.com/s/1prPHLJKwoKK505i5qTVZ7g
提取码: egj6
有百度云可以下载,然后放入本机目录。
这里目录有两种,一是放入anaconda安装目录的Scripts目录,我的是D:\anaconda\Scripts目录;二是放入Anaconda环境的Scripts目录,我的是D:\anaconda\envs\uav\Scripts(uav是我自己的环境,可通过命令conda create -n name python=3.6创建环境)。
最后,在D:\Anaconda3\Scripts目录下在空白处按住shift加右键打开cmd,输入以下命令即可。
pip install GDAL‑3.0.1‑cp38‑cp38‑win_amd64.whl
注:若用pip安装gdal会报错:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gdal
报错信息如下:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting gdal
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/26/c6/f8846ba726b37f9a1099acb5bff43c309fb913577674c1ba491f6fc60598/GDAL-3.0.1.tar.gz (576kB)
|████████████████████████████████| 583kB 810kB/s
Building wheels for collected packages: gdal
Building wheel for gdal (setup.py) ... error
ERROR: Complete output from command /home/dennis/miniconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-i321u6em/gdal/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-aaneihet --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
copying gdal.py -> build/lib.linux-x86_64-3.7
copying ogr.py -> build/lib.linux-x86_64-3.7
copying osr.py -> build/lib.linux-x86_64-3.7
copying gdalconst.py -> build/lib.linux-x86_64-3.7
copying gdalnumeric.py -> build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/osr.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/gnm.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/gdal.py -> build/lib.linux-x86_64-3.7/osgeo
copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.7/osgeo
Fixing build/lib.linux-x86_64-3.7/gdal.py build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。