I have a Python script that batch converts GPX files stored on an older Garmin unit to ESRI shapefiles. This script use an ogr2ogr command line argument passed from Python using
subprocess.call() to do the conversions. This all works very nicely on my Linux computer that I typically use for script development. I have full permissions on this computer.
Now I am converting the script to a Windows specific computer to which I do not have administrative rights. Furthermore, my Python environment is behind a walled-garden using ArcGIS Pro 2.7. When my script gets to the ogr2ogr conversion and
subprocess.call() I get an error message
'ogr2ogr' is not recognized as an internal or external command, operable program or batch file.
A previous post referring to Windows 7 stated that one should either set Environment Path Variables (which I cannot do since I do not have admin rights or run this command line statement
"set path=%path%;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\osgeo\". As a test of all this I can run "set path" stuff without error in a Windows Power Shell but when I use the power shell to run
ogr2ogr -f " Shapefile" Waypoint.shp Waypoints_01-OCT-19.gpx in the directory with the GPX I get the error below.
`ogr2ogr : The term 'ogr2ogr' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + ogr2ogr -f "ESRI Shapefile" Waypoint.shp Waypoints_01-OCT-19.gpx + ~~~~~~~ + CategoryInfo : ObjectNotFound: (ogr2ogr:String) , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException`
How do I get my ogr2ogr command to run using Python and Windows 10?