Pyinstaller - Calling GDAL from os.system (gdal_translate)

两盒软妹~` 提交于 2019-12-06 04:28:36

From GDAL 2.1 you can use the 'librified' version of gdal_translate in the python bindings, which may be more robust and prevent you from having to muck about with the path:

import gdal
gdal.Translate(<options>)

Some examples of it being used can be found in the test suite of the gdal repository: https://svn.osgeo.org/gdal/trunk/autotest/utilities/test_gdal_translate_lib.py

You can pip install gdal and I believe it is the 2.1 release (on linux). For windows, the easiest way to install is with conda.

This should prevent you from having to mess around including binaries/paths in pyinstaller too much as it can be treated like any python module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!