问题
我有一个gdal2tiles.bat文件,上面写着
@echo off
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
python "%OSGEO4W_ROOT%\apps\Python39\Scripts\gdal2tiles.py" %*
但是,当我以gdal2tiles earth.tif
或gdal2tiles.bat earth.tif
的形式从Powershell运行脚本时,错误消息显示
The system cannot find the path specified. python: can't open file 'C:\apps\Python39\Scripts\gdal2tiles.py': [Errno 2] No such file or directory
解决方法
我编辑.bat文件以放置.py文件的文件路径,如下面的代码所示。我运行它,它说The system cannot find the path specified.
,然后脚本按预期运行,输出正确
@echo off
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
python "C:\OSGeo4W\apps\Python39\Scripts\gdal2tiles.py" %*
然而,gdal2tiles.py只是该文件夹中众多Python脚本中的一个。如果我需要运行另一个脚本,我需要再次编辑它的.bat文件
我以前的帖子与此类似https://gis.stackexchange.com/q/414053/146811
不需要我编辑所有.bat文件的好方法是什么?
目前没有回答
相关问题 更多 >
编程相关推荐