Unable to find GDAL library in conda env

I have a Django project configured with PyCharm. I am using a conda env for packages installations. I have installed gdal. But when I run server, I see:

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal310", "gdal309", "gdal308", "gdal307", "gdal306", "gdal305", "gdal304", "gdal303", "gdal302", "gdal301"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.

I have added this at top of settings.py:

import os

os.environ['GDAL_LIBRARY_PATH'] = r'C:\Users\Admin\.conda\envs\my-env\Library\bin\gdal.dll'

I even added GDAL_LIBRARY_PATH globally as user variable, but I still see this error.

How to get it working?

Вернуться на верх