OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

ImportError: No module named gdal

  • Thread starter Thread starter maRtin
  • Start date Start date
M

maRtin

Guest
My GDAL is showing strange behaviour when I try to use ".py" functions from the command line:

1. For example, when I run gdalinfo --version, I get the standard response:

Code:
GDAL 1.11.3, released 2015/09/16

2. Also when I run gdalwarp, I get the standard response showing me the flags and everything.

3. Problem: However, when I run gdal functions with a .py extension, for example gdal_polygonize.py, I get the following:

Code:
Traceback <most recent call last>:
    File "C:\OSGeoW64\bin\gdal_polygonize.py", line 36, in <module>
    import gdal, ogr, osr
ImportError: No module named gdal

I checked my Path variable, reinstalled python and gdal, but nothing worked. When I run the gdal_polygonize.py function from my QGIS it works. I just can`t use it from my command line.
<p>My GDAL is showing strange behaviour when I try to use ".py" functions from the command line:</p>

<p><strong>1.</strong> For example, when I run <code>gdalinfo --version</code>, I get the standard response:</p>

<pre><code>GDAL 1.11.3, released 2015/09/16
</code></pre>

<p><strong>2.</strong> Also when I run <code>gdalwarp</code>, I get the standard response showing me the flags and everything.</p>

<p><strong>3. Problem:</strong>
However, when I run gdal functions with a .py extension, for example <code>gdal_polygonize.py</code>, I get the following:</p>

<pre><code>Traceback <most recent call last>:
File "C:\OSGeoW64\bin\gdal_polygonize.py", line 36, in <module>
import gdal, ogr, osr
ImportError: No module named gdal
</code></pre>

<p>I checked my Path variable, reinstalled python and gdal, but nothing worked.
When I run the <code>gdal_polygonize.py</code> function from my QGIS it works. I just can`t use it from my command line.</p>
 

Latest posts

Top