[GIS] “Cannot find proj.db” and “ERROR 1: PROJ: proj_create_from_database: cannot build geodeticCRS 4326” errors

coordinate systemmacosqgis

Updated to QGIS 3.16 recently, when I try to reproject from the datafiles CRS EPSG:4326 – WG 84 to EPSG:32718 – WG84/UTM zone 18S I get this error

ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db

ERROR 1: Translating source or target SRS failed:

EPSG:32718  

I am using macOS and I updated to by downloading software from the website https://qgis.org/en/site/forusers/download.html – the latest release

I have located the proj.db in my computer C:/Users/anaconda3/envs/gsa_sm2019/share/proj/proj.db
and tried to change the setting environment.

I tried

import os os.environ['PROJ_LIB'] =
'C:/Users/anaconda3/envs/gsa_sm2019/share/proj'
os.environ['GDAL_DATA'] = 'C:/Users/anaconda3/envs/gsa_sm2019/share'
import gdal

Reprojected again, this is the new error received:

ERROR 1: PROJ: proj_create_from_database: cannot build geodeticCRS
4326: SQLite error on SELECT name, ellipsoid_auth_name,
ellipsoid_code, prime_meridian_auth_name, prime_meridian_code,
area_of_use_auth_name, area_of_use_code, publication_date, deprecated
FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column:
publication_date
ERROR 1: Translating source or target SRS failed:
EPSG:4326

Best Answer

I believe PROJ_LIB should be set to the directory where proj.db lives, not the file itself.

Related Question