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?
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.
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).