[gdal-dev] Python (2.6.5) GDAL module will not install with easy_install

Allen Rongone arongone at aer.com
Tue May 11 14:32:57 EDT 2010


Brice,

	Thank you for all your help. However, I did want to know if I need to  
back out all the gdal-1.7.2 I just installed before I start over, or  
can I just run the make clean/ configure /make /make install, again  
after I remove the old gdal from the system? And if so, how would that  
be done?

Thanks again,
Allen


On May 11, 2010, at 2:10 PM, Brice Lambi wrote:

> It really looks like a linking error, make sure that
> /opt/GOESR/local/lib is in your LD_LIBRARY_PATH before /usr/lib or
> /usr/local/lib.  If you won't use it, it would probably be best to
> remove all gdal stuff from yum just to avoid any confusion.
>
> Also when you ran python setup.py install in the swig/python area make
> sure you see something like -L/opt/GEOSR/local/lib in the compiler
> commands flying across your screen.  If you don't see this, and your
> LD_LIBRARY_PATH isn't setup it is probably still trying to use  
> something
> in /usr/
>
> Good luck,
> Brice
>
>
> Allen Rongone wrote:
>>
>> On May 11, 2010, at 1:19 PM, Brice Lambi wrote:
>>
>>> What is your python path?
>>>
>>> # python
>>>>>> import sys
>>>>>> sys.path
>>>
>>> What does that say?  It might have linked against the wrong  
>>> version of
>>> gdal or it might be finding another gdal library in your path.  If  
>>> you
>>> are using the default python (/usr/bin/python) it is probably  
>>> finding
>>> something in /usr/lib before /opt/GEOSR/local.
>>>
>>
>> Here is the output from the command above:
>>
>> [root at psd14 ~]# python
>> Python 2.6.5 (r265:79063, May  3 2010, 14:23:56)
>> [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
>> Type "help", "copyright", "credits" or "license" for more  
>> information.
>>>>> import sys
>>>>> sys.path
>> ['',
>> '/opt/GOESR/local/lib/python2.6/site-packages/setuptools-0.6c11- 
>> py2.6.egg',
>> '/opt/GOESR/local/lib/python2.6/site-packages/numpy-1.4.1-py2.6- 
>> linux-x86_64.egg',
>> '/opt/GOESR/local/lib/python2.6/site-packages/scipy-0.7.2-py2.6- 
>> linux-x86_64.egg',
>> '/opt/GOESR/local/lib/python2.6/site-packages/matplotlib-0.99.1.1- 
>> py2.6-linux-x86_64.egg',
>> '/opt/GOESR/local/lib/python2.6/site-packages/GDAL-1.7.2-py2.6- 
>> linux-x86_64.egg',
>> '/opt/GOESR/local/lib/python26.zip', '/opt/GOESR/local/lib/ 
>> python2.6',
>> '/opt/GOESR/local/lib/python2.6/plat-linux2',
>> '/opt/GOESR/local/lib/python2.6/lib-tk',
>> '/opt/GOESR/local/lib/python2.6/lib-old',
>> '/opt/GOESR/local/lib/python2.6/lib-dynload',
>> '/opt/GOESR/local/lib/python2.6/site-packages']
>>>>>
>> [root at psd14 ~]# which python
>> /opt/GOESR/local/bin/python
>>
>>
>>
>> There still exists version 1.4.4 of gdal and gdal-devel from the  
>> Red Hat
>> build, on this system, but they don't show up in the path.
>>
>> Is there a way to back out everything?
>>
>> Then I could remove gdal 1.4.4. with yum and try to install from the
>> tarball again.
>>
>> Does this make sense?
>>
>> Sorry for all the trouble...
>>
>> ~ Allen
>>
>>
>>>
>>>
>>>
>>> Allen Rongone wrote:
>>>> Brice,
>>>>
>>>>   I think I was using the tarball specific to the python module. I
>>>> think I downloaded the correct one now - gdal-1.7.2.tar.gz
>>>>
>>>>   I ran the configure script as such:
>>>>
>>>>   # ./configure --prefix=/opt/GOESR/local --with-python
>>>>
>>>>   Then a make
>>>>   # make
>>>>
>>>>   Then a make install
>>>>   # make install
>>>>
>>>>
>>>>   Everything seemed fine until I tried to import the module in  
>>>> python.
>>>> I got this when I tried:
>>>>
>>>>
>>>>> [root at psd14 gdal-1.7.2]# python
>>>>> Python 2.6.5 (r265:79063, May  3 2010, 14:23:56)
>>>>> [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
>>>>> Type "help", "copyright", "credits" or "license" for more  
>>>>> information.
>>>>>>>> from osgeo import gdal
>>>>> Traceback (most recent call last):
>>>>> File "<stdin>", line 1, in <module>
>>>>> File
>>>>> "/opt/GOESR/local/lib/python2.6/site-packages/GDAL-1.7.2-py2.6- 
>>>>> linux-x86_64.egg/osgeo/__init__.py",
>>>>>
>>>>> line 21, in <module>
>>>>>   _gdal = swig_import_helper()
>>>>> File
>>>>> "/opt/GOESR/local/lib/python2.6/site-packages/GDAL-1.7.2-py2.6- 
>>>>> linux-x86_64.egg/osgeo/__init__.py",
>>>>>
>>>>> line 17, in swig_import_helper
>>>>>   _mod = imp.load_module('_gdal', fp, pathname, description)
>>>>> ImportError:
>>>>> /opt/GOESR/local/lib/python2.6/site-packages/GDAL-1.7.2-py2.6- 
>>>>> linux-x86_64.egg/osgeo/_gdal.so:
>>>>>
>>>>> undefined symbol: GDALGetMaskFlags
>>>>>>>>
>>>>
>>>> Any ideas why I'm getting the ImportError with the undefined  
>>>> symbol?
>>>>
>>>> Thank you very much for your help,
>>>> Allen Rongone
>>>>
>>>>
>>>> On May 6, 2010, at 12:47 PM, Brice Lambi wrote:
>>>>
>>>>> Hi Allen,
>>>>>
>>>>> Are you compiling from source?  When I install gdal python I  
>>>>> just go
>>>>> into the swig/python directory and run 'python setup.py  
>>>>> install'.  This
>>>>> should work.  The steps I take:
>>>>>
>>>>> tar zxvf gdal-1.7.1.tar.gz
>>>>> cd gdal-1.7.1
>>>>> ./configure --prefix=/usr
>>>>> make
>>>>> make install #run as root
>>>>> cd swig/python
>>>>> python setup.py install #run as root
>>>>>
>>>>> Hope this helps.
>>>>>
>>>>> Cheers,
>>>>> Brice
>>>>>
>>>>>
>>>>> Allen Rongone wrote:
>>>>>> Hello All,
>>>>>>
>>>>>>  New here so don't beat me up to bad.
>>>>>>
>>>>>>  I'm trying to get the GDAL module to install on a Red Hat  
>>>>>> Enterprise
>>>>>> Linux 5.4 64-bit workstation running Python 2.6.5.
>>>>>>
>>>>>>  I have installed the setuptools 0.6c11 and am using easy_install
>>>>>>
>>>>>>  My gdal-config is in /usr/bin, however, when I run  
>>>>>> easy_install GDAL
>>>>>> it complains that it "Could not run gdal-config!!!" and then
>>>>>> contiues on
>>>>>> complaining about a bunch of stuff not
>>>>>>  being declared.
>>>>>>
>>>>>>  I can not find the setup.py to edit and change the location of
>>>>>> gdal-config. easy_install must clean everything up if it fails.
>>>>>>
>>>>>>
>>>>>>
>>>>>>  Does anyone know how to get this to work or will we have to do
>>>>>> without GDAL in python?
>>>>>>
>>>>>> Thanks for any help,
>>>>>> Allen
>>>>>>
>>>>>> I've included everything I thought pertinent below:
>>>>>>
>>>>>>
>>>>>> [root at psd14 ~]# uname -a
>>>>>> Linux psd14.aer.com 2.6.18-164.15.1.el5 #1 SMP Mon Mar 1  
>>>>>> 10:56:08 EST
>>>>>> 2010 x86_64 x86_64 x86_64 GNU/Linux
>>>>>> [root at psd14 ~]# python
>>>>>> Python 2.6.5 (r265:79063, May  3 2010, 14:23:56)
>>>>>> [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
>>>>>> Type "help", "copyright", "credits" or "license" for more  
>>>>>> information.
>>>>>>>>>
>>>>>> KeyboardInterrupt
>>>>>>>>>
>>>>>> [root at psd14 ~]# which gdal-config
>>>>>> /usr/bin/gdal-config
>>>>>> [root at psd14 ~]# easy_install GDAL
>>>>>> Searching for GDAL
>>>>>> Reading http://pypi.python.org/simple/GDAL/
>>>>>> Reading http://www.gdal.org
>>>>>> Best match: GDAL 1.7.1
>>>>>> Downloading
>>>>>> http://pypi.python.org/packages/source/G/GDAL/GDAL-1.7.1.tar.gz#md5 
>>>>>> =38b838d528b309a28a3aa24d4fcef3cd
>>>>>>
>>>>>>
>>>>>>
>>>>>> Processing GDAL-1.7.1.tar.gz
>>>>>> Running GDAL-1.7.1/setup.py -q bdist_egg --dist-dir
>>>>>> /tmp/easy_install-eKZHzW/GDAL-1.7.1/egg-dist-tmp-siVuDI
>>>>>> Could not run gdal-config!!!!
>>>>>> cc1plus: warning: command line option "-Wstrict-prototypes" is
>>>>>> valid for
>>>>>> Ada/C/ObjC but not for C++
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> GDALDriverShadow_Rename(GDALDriverShadow*, const char*, const
>>>>>> char*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:3371: error:
>>>>>> $(B!F(BGDALRenameDataset$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(BCPLErr
>>>>>> GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow*, int)$(B! 
>>>>>> G(B:
>>>>>> extensions/gdal_wrap.cpp:3744: error:
>>>>>> $(B!F(BGDALCreateDatasetMaskBand$(B!G(B was not declared in  
>>>>>> this
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bchar**
>>>>>> GDALDatasetShadow_GetFileList(GDALDatasetShadow*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:3747: error:
>>>>>> $(B!F(BGDALGetFileList$(B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B! 
>>>>>> F(BGDALRasterBandShadow*
>>>>>> GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4077: error:
>>>>>> $(B!F(BGDALGetMaskBand$(B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow*)$(B! 
>>>>>> G(B:
>>>>>> extensions/gdal_wrap.cpp:4080: error:
>>>>>> $(B!F(BGDALGetMaskFlags$(B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(BCPLErr
>>>>>> GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow*,
>>>>>> int)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4083: error:
>>>>>> $(B!F(BGDALCreateMaskBand$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bvoid
>>>>>> GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow*,  
>>>>>> int, const
>>>>>> GDALColorEntry*, int, const GDALColorEntry*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4147: error:
>>>>>> $(B!F(BGDALCreateColorRamp$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> ComputeProximity(GDALRasterBandShadow*, GDALRasterBandShadow*,  
>>>>>> char**,
>>>>>> int (*)(double, const char*, void*), void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4306: error:
>>>>>> $(B!F(BGDALComputeProximity$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> RasterizeLayer(GDALDatasetShadow*, int, int*, OGRLayerShadow*,  
>>>>>> void*,
>>>>>> void*, int, double*, char**, int (*)(double, const char*, void*),
>>>>>> void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4342: error:
>>>>>> $(B!F(BGDALRasterizeLayers$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> Polygonize(GDALRasterBandShadow*, GDALRasterBandShadow*,
>>>>>> OGRLayerShadow*, int, char**, int (*)(double, const char*,  
>>>>>> void*),
>>>>>> void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4362: error: $(B!F(BGDALPolygonize$ 
>>>>>> (B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> FillNodata(GDALRasterBandShadow*, GDALRasterBandShadow*,  
>>>>>> double, int,
>>>>>> char**, int (*)(double, const char*, void*), void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4378: error: $(B!F(BGDALFillNodata$ 
>>>>>> (B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> SieveFilter(GDALRasterBandShadow*, GDALRasterBandShadow*,
>>>>>> GDALRasterBandShadow*, int, int, char**, int (*)(double, const  
>>>>>> char*,
>>>>>> void*), void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4394: error:
>>>>>> $(B!F(BGDALSieveFilter$(B!G(B
>>>>>> was not declared in this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> RegenerateOverviews(GDALRasterBandShadow*, int,
>>>>>> GDALRasterBandShadow**,
>>>>>> const char*, int (*)(double, const char*, void*), void*)$(B! 
>>>>>> G(B:
>>>>>> extensions/gdal_wrap.cpp:4408: error: invalid conversion from
>>>>>> $(B!F(BGDALRasterBandShadow*$(B!G(B to
>>>>>> $(B!F(BGDALRasterBand*$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4408: error:   initializing  
>>>>>> argument 1
>>>>>> of $(B!F(BCPLErr GDALRegenerateOverviews(GDALRasterBand*, int,
>>>>>> GDALRasterBand**, const char*, int (*)(double, const char*,  
>>>>>> void*),
>>>>>> void*)$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4408: error: invalid conversion from
>>>>>> $(B!F(BGDALRasterBandShadow**$(B!G(B to
>>>>>> $(B!F(BGDALRasterBand**$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4408: error:   initializing  
>>>>>> argument 3
>>>>>> of $(B!F(BCPLErr GDALRegenerateOverviews(GDALRasterBand*, int,
>>>>>> GDALRasterBand**, const char*, int (*)(double, const char*,  
>>>>>> void*),
>>>>>> void*)$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> RegenerateOverview(GDALRasterBandShadow*,  
>>>>>> GDALRasterBandShadow*, const
>>>>>> char*, int (*)(double, const char*, void*), void*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4421: error: invalid conversion from
>>>>>> $(B!F(BGDALRasterBandShadow*$(B!G(B to
>>>>>> $(B!F(BGDALRasterBand*$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4421: error:   initializing  
>>>>>> argument 1
>>>>>> of $(B!F(BCPLErr GDALRegenerateOverviews(GDALRasterBand*, int,
>>>>>> GDALRasterBand**, const char*, int (*)(double, const char*,  
>>>>>> void*),
>>>>>> void*)$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4421: error: invalid conversion from
>>>>>> $(B!F(BGDALRasterBandShadow**$(B!G(B to
>>>>>> $(B!F(BGDALRasterBand**$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp:4421: error:   initializing  
>>>>>> argument 3
>>>>>> of $(B!F(BCPLErr GDALRegenerateOverviews(GDALRasterBand*, int,
>>>>>> GDALRasterBand**, const char*, int (*)(double, const char*,  
>>>>>> void*),
>>>>>> void*)$(B!G
>>>>>> (Bextensions/gdal_wrap.cpp: In function
>>>>>> $(B!F(BGDALTransformerInfoShadow*
>>>>>> new_GDALTransformerInfoShadow(GDALDatasetShadow*,
>>>>>> GDALDatasetShadow*, char**)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4445: error:
>>>>>> $(B!F(BGDALCreateGenImgProjTransformer2$(B!G(B was not  
>>>>>> declared in
>>>>>> this scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> GDALTransformerInfoShadow_TransformPoint__SWIG_0 
>>>>>> (GDALTransformerInfoShadow*,
>>>>>>
>>>>>>
>>>>>> int, double*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4456: error:
>>>>>> $(B!F(BGDALUseTransformer$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> GDALTransformerInfoShadow_TransformPoint__SWIG_1 
>>>>>> (GDALTransformerInfoShadow*,
>>>>>>
>>>>>>
>>>>>> double*, int, double, double, double)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4468: error:
>>>>>> $(B!F(BGDALUseTransformer$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(Bint
>>>>>> GDALTransformerInfoShadow_TransformPoints 
>>>>>> (GDALTransformerInfoShadow*,
>>>>>> int, int, double*, double*, double*, int*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4550: error:
>>>>>> $(B!F(BGDALUseTransformer$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(BGDALDriverShadow*
>>>>>> IdentifyDriver(const char*, char**)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:4661: error:
>>>>>> $(B!F(BGDALIdentifyDriver$(B!G(B was not declared in this  
>>>>>> scope
>>>>>> extensions/gdal_wrap.cpp: In function $(B!F(BPyObject*
>>>>>> _wrap_ReadDir(PyObject*, PyObject*)$(B!G(B:
>>>>>> extensions/gdal_wrap.cpp:5255: error: $(B!F(BVSIReadDir$(B! 
>>>>>> G(B was
>>>>>> not declared in this scope
>>>>>> error: Setup script exited with error: command 'gcc' failed  
>>>>>> with exit
>>>>>> status 1
>>>>>> [root at psd14 ~]#
>>>>>>
>>>>>> _______________________________________________
>>>>>> gdal-dev mailing list
>>>>>> gdal-dev at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>>>
>>>
>



More information about the gdal-dev mailing list