[gdal-dev] OpenEx not found - gdal_edit.py

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] OpenEx not found - gdal_edit.py

asmita
Enviroment /OS -

Ubuntu 16.04  - gdal 2.1.2 already installed with Python2.7 used to build GDAL.

VERSIONS -

gdal 2.1.2 when installed bundled with the code :
'--with-python=%s '
where s% is gdal_env['python_bin'],

ISSUE-
Trying to execute gdal_edit.py (or gdal2tiles.py, gdal_retile.py etc.) , fails to find osgeo module. ImportError: No module named osgeo

Fix1:  sudo apt-get install python-gdal
This fixed the issue of osgeo, but specifically, when I am trying to run gdal_edit.py ,it does not find some of the methods from 2.1.2

RUN gdal_edit.py

/opt/google/bin/gdal_edit.py -a_srs EPSG:3857 RGB-corrected.tif
Traceback (most recent call last):
  File "/opt/google/bin/gdal_edit.py", line 274, in <module>
    sys.exit(gdal_edit(sys.argv))
  File "/opt/google/bin/gdal_edit.py", line 191, in gdal_edit
    ds = gdal.OpenEx(datasetname, gdal.OF_RASTER | gdal.OF_UPDATE, open_options = open_options)
AttributeError: 'module' object has no attribute 'OpenEx'

OpenEx is part of 2.1.2 as I remember , please confirm how to check if I installed correct version of python-gdal

--
Thanks,
Asmita

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenEx not found - gdal_edit.py

Even Rouault-2

On vendredi 8 septembre 2017 02:13:42 CEST Asmita Amol Wankhede wrote:

> Enviroment /OS -

>

> Ubuntu 16.04 - gdal 2.1.2 already installed with Python2.7 used to build

> GDAL.

>

> VERSIONS -

>

> gdal 2.1.2 when installed bundled with the code :

> '--with-python=%s '

> where s% is gdal_env['python_bin'],

>

> ISSUE-

> Trying to execute gdal_edit.py (or gdal2tiles.py, gdal_retile.py etc.) ,

> fails to find osgeo module. ImportError: No module named osgeo

>

> Fix1: sudo apt-get install python-gdal

 

This has certainly install the python bindings for GDAL 1.11, which is the default on 16.04

 

You likely need to adjust the PYTHONPATH to point where the python bindings of your 2.1.2 builds have been installed

 

Or alternatively just add the

https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa to your APT sources and use uptodate GDAL from it.

 

> This fixed the issue of osgeo, but specifically, when I am trying to run

> gdal_edit.py ,it does not find some of the methods from 2.1.2

>

> RUN gdal_edit.py

>

> /opt/google/bin/gdal_edit.py -a_srs EPSG:3857 RGB-corrected.tif

> Traceback (most recent call last):

> File "/opt/google/bin/gdal_edit.py", line 274, in <module>

> sys.exit(gdal_edit(sys.argv))

> File "/opt/google/bin/gdal_edit.py", line 191, in gdal_edit

> ds = gdal.OpenEx(datasetname, gdal.OF_RASTER | gdal.OF_UPDATE,

> open_options = open_options)

> AttributeError: 'module' object has no attribute 'OpenEx'

>

> OpenEx is part of 2.1.2 as I remember , please confirm how to check if I

> installed correct version of python-gdal

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev