Hello,
When PROJ is installed from anaconda official repositories, an environment variable “PROJ_LIB” is not correctly set for powershell.
The error “PROJ: proj_create_from_database: Cannot find proj.db” occurs.
This seems to be because activation and deactivation scripts do not exist in CONDA_PREFIX/etc/conda/activate.d and CONDA_PREFIX/etc/conda/deactivate.d.
The versions are,
- conda: 23.5.0
- proj: 6.2.1
- pypro: j2.6.1.post1
Adding following scripts into activate.d and deactivate.d fixes this situation.
# CONDA_PREFIX/etc/conda/activate.d/proj4-activate.ps1
if ($env:PROJ_LIB) {
$env:_CONDA_SET_PROJ_LIB=$env:PROJ_LIB
}
$ENV:PROJ_LIB="$ENV:CONDA_PREFIX\Library\share\proj"
# CONDA_PREFIX/etc/conda/deactivate.d/proj4-deactivate.ps1
if ($env:PROJ_LIB) {
$env:_CONDA_SET_PROJ_LIB=$env:PROJ_LIB
}
$ENV:PROJ_LIB="$ENV:CONDA_PREFIX\Library\share\proj"