Issue when imoporting GDAL : ImportError, Library not loaded, Image not found

两盒软妹~` 提交于 2019-12-04 08:44:35

I found a solution to my problem here.

Thank you for the clear explanation of "ocefpaf":

You problem seems like the usuall mismatch between conda-forge and defaults. Can you try the following instructions (if you do want to use conda-forge's gdal of course):

  1. Make sure you have the latest conda to take advantage of the channel preference feature. You can do that by issuing conda update conda in the root env of your conda installation.

  2. Edit your .condarc file and place the conda-forge on top of defaults. The .condarc usually lives in your home directory. See mine below. (Note that the more channels you have you are more likely to face issues. I recommend having only defaults and conda-forge.)

  3. Issue the following commands to check if you will get the correct installation:

conda create --yes -n TEST_GDAL python=3.5 gdal
source activate TEST_GDAL
python -c "from osgeo import gdal; print(gdal.__version__)"

If you get 2.1.1 you got a successful installation of the latest version from conda-forge. We always recommend users to work with envs as the the example above. But you do not need to use Python 3.5 (conda-forge has 3.4 and 2.7 also) and you do not need to name the env TEST_GDAL.

And here is my .condarc file.

> cat .condarc
channels:
- conda-forge
- defaults
show_channel_urls: true
Qina Yan

I have the same problem.

conda install -f jpeg=8

conda install libgdal

solve my problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!