2

I created a virtual python environment and installed the GDAL-Wheel into it:

When I run my python-program I get the following message:

ERROR 1: PROJ: proj_identify: C:\Program Files\PostgreSQL\11\share\contrib\postgis-3.2\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 0 whereas a number >= 2 is expected. It comes from another PROJ installation.

I have also installed postgresSQL 11 on my machine.

Seems GDAL-Wheel and PostgresSQL 11 interfere /disturb each other?

the GDAL-wheel is from: https://www.lfd.uci.edu/~gohlke/pythonlibs/

Lee Goddard
  • 10,680
  • 4
  • 46
  • 63
Kurt
  • 264
  • 1
  • 7
  • 23
  • Your venv's GDAL wheel should not affect Postgres in any way. What's your program? Why do you have Postgres 11? It's 3 major versions old. – AKX Mar 13 '22 at 20:13
  • I am using Python 3.10. Postgres 11 is still supported ! – Kurt Mar 13 '22 at 20:35
  • 3
    The GDAL package and PostgreSQL installation include different/conflicting versions of PROJ. Try to unset the `PROJ_LIB` environment variable if it is defined. – cgohlke Mar 14 '22 at 02:35
  • @cgohlke Unsettting the PROJ_LIB environment variable works and the error-message in Python disappears, but can I still use the PostGIS-extension in my PostgresSQL-Server 11? – Kurt Mar 14 '22 at 17:43
  • 3
    Try to leave the `PROJ_LIB` environment variable defined in Windows and undefine `PROJ_LIB` before importing pyproj or osgeo: `del os.environ['PROJ_LIB']`. – cgohlke Mar 14 '22 at 17:55
  • @cgohlke thanks, undefining by del os.environ['PROJ_LIB'] worked great! If you are willing to post your comment as answer I will of course accept this answer as solution of the problem. Thank you for your kind support – Kurt Mar 14 '22 at 19:07
  • Is there any chance that this might be fixed one day? – s6hebern Jun 14 '22 at 06:15

1 Answers1

0

Check the package path under system environment its probably pointing to PostGIS folder. Get the windows binary pyproj file from the site you got the GDAL. Install with pip install, after it's done re run the pip install command to get the directory path. Now just change the variable path for PROJ_LIB under system environment variables.

Avidqtaqtx
  • 18
  • 2