Rasterio errors the EPSG code is unknown

906
2
06-07-2022 06:34 PM
MirandaLv
New Contributor

I received the attached errors after running my python toolbox script from ArcGIS Pro geoprocessing tool, but same script if I run it in pycharm with the python interpreter pointed to the cloned arcgispro-py3 environment, the script runs without any issue.

I tested multiple options, and found out that in the python windows in ArcGIS pro, the GDAL_DATA does not exist in the os.environ, if adding the GDAL_DATA path to os.environ and then run the same code in the toolbox, it works fine. 

Does anyone know how to solve this problem without manually adding the GDAL_DATA to os.environ every time?

Tags (2)
0 Kudos
2 Replies
by Anonymous User
Not applicable

I haven't tried this within Arc Pro, but have you tried to set a conda environment variable ?

I'm curious if it behaves as expected.

0 Kudos
MirandaLv
New Contributor

Thanks for your reply, but it doesn't work. The python script was running in the conda environment (pointed to the cloned arcgis-py3), and it works, but not in arcgis pro (running in toolbox python script).

0 Kudos