We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported here and the full logfile is pasted below: https://community.naturalcapitalproject.org/t/issue-with-missing-output-folder-when-running-ndr-module-in-invest-model/5714/8
I was able to reproduce this by setting my PROJ_LIB and PROJ_DATA to erroneous values and then running NDR from the CLI.
PROJ_LIB
PROJ_DATA
We have a pyinstaller runtime hook to set PROJ_LIB: os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')
os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')
But it seems that if PROJ_DATA also exists and is erroneous, then we'll get this RuntimeError anyway.
RuntimeError
So I think if we also set PROJ_DATA in the runtime hook, we'll be okay:
os.environ['PROJ_DATA'] = os.path.join(sys._MEIPASS, 'proj') os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')
Arguments for InVEST natcap.invest.ndr.ndr 3.14.3: biophysical_table_path E:\1论文水质净化数�处�\氮磷截留率2.csv calc_n True calc_p True dem_path E:\a大论文\gis处�过程\大论文图\DEM1.tif k_param 2 lulc_path E:\a大论文\flus\生��护 预测2035.tif n_workers -1 results_suffix runoff_proxy_path E:\2020zxl产水\2020Pr.ZH.tif subsurface_critical_length_n 2 subsurface_eff_n 0.5 threshold_flow_accumulation 1000 watersheds_path E:\a大论文\gis处�过程\大论文图\Watershed1.shp workspace_dir E:\2035生��护情景水质净化输出结果 2025-01-17 20:21:15,205 (taskgraph.Task) Task.add_task(706) ERROR Something went wrong when adding task create target vector (0), terminating taskgraph. Traceback (most recent call last): File "taskgraph\Task.py", line 674, in add_task File "taskgraph\Task.py", line 1093, in _call File "natcap\invest\ndr\ndr.py", line 1451, in create_vector_copy File "src\\pygeoprocessing\\geoprocessing_core.pyx", line 77, in pygeoprocessing.geoprocessing_core.gdal_use_exceptions.wrapper File "src\\pygeoprocessing\\geoprocessing_core.pyx", line 78, in pygeoprocessing.geoprocessing_core.gdal_use_exceptions.wrapper File "pygeoprocessing\geoprocessing.py", line 2017, in get_vector_info File "osgeo\gdal.py", line 4669, in GetFileList RuntimeError: PROJ: proj_identify: Cannot find proj.db 2025-01-17 20:21:15,206 (natcap.invest.utils) utils.prepare_workspace(188) ERROR Exception while executing natcap.invest.ndr.ndr Traceback (most recent call last): File "natcap\invest\utils.py", line 186, in prepare_workspace File "invest\cli.py", line 472, in main File "natcap\invest\ndr\ndr.py", line 585, in execute File "taskgraph\Task.py", line 674, in add_task File "taskgraph\Task.py", line 1093, in _call File "natcap\invest\ndr\ndr.py", line 1451, in create_vector_copy File "src\\pygeoprocessing\\geoprocessing_core.pyx", line 77, in pygeoprocessing.geoprocessing_core.gdal_use_exceptions.wrapper File "src\\pygeoprocessing\\geoprocessing_core.pyx", line 78, in pygeoprocessing.geoprocessing_core.gdal_use_exceptions.wrapper File "pygeoprocessing\geoprocessing.py", line 2017, in get_vector_info File "osgeo\gdal.py", line 4669, in GetFileList RuntimeError: PROJ: proj_identify: Cannot find proj.db 2025-01-17 20:21:15,210 (natcap.invest.utils) utils.prepare_workspace(191) INFO Elapsed time: 0.03s 2025-01-17 20:21:15,210 (natcap.invest.utils) utils.prepare_workspace(194) INFO Execution finished; version: 3.14.3
The text was updated successfully, but these errors were encountered:
set PROJ_LIB and PROJ_DATA variables in the exe runtime hook. natcap#…
b13e90e
…1742
a note for HISTORY. natcap#1742
33d50c5
fix RST markup. natcap#1742
7600643
resolved HISTORY conflict. natcap#1742
bfdc551
davemfish
Successfully merging a pull request may close this issue.
Reported here and the full logfile is pasted below: https://community.naturalcapitalproject.org/t/issue-with-missing-output-folder-when-running-ndr-module-in-invest-model/5714/8
I was able to reproduce this by setting my
PROJ_LIB
andPROJ_DATA
to erroneous values and then running NDR from the CLI.We have a pyinstaller runtime hook to set
PROJ_LIB
:os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')
But it seems that if
PROJ_DATA
also exists and is erroneous, then we'll get thisRuntimeError
anyway.So I think if we also set
PROJ_DATA
in the runtime hook, we'll be okay:The text was updated successfully, but these errors were encountered: