[Gdal-dev] Python Support on MacOSX

BABA Yoshihiko baba.yoshihiko at gmail.com
Sat Jun 4 00:55:22 EDT 2005


Hi

I am not good at python and want help from Pythonists. This is for
GDAL-1.2.6 and Python 2.3 (not System's) on MacOSX 10.3.9.

I'm trying to make gdal package for Fink on MacOSX with Python
support. When I did as follows, it built and installed everything:

    perl -pi.bak -e 's,^PYTHON_INCLUDES =
\@PYTHON_INCLUDES\@,PYTHON_INCLUDES = -I%p/include/python2.3
-I%p/include/python2.3/Numeric,' GDALmake.opt.in
    perl -pi.bak -e 's,^PYTHON_LIBS = \@PYTHON_LIBS\@,PYTHON_LIBS =
-L/sw/lib/python2.3/config -lpython2.3,' GDALmake.opt.in
    perl -pi.bak -e 's,^PYTHON_CFLAGS = \@PYTHON_CFLAGS\@
\@NUMPY_FLAG\@,PYTHON_CFLAGS =  -I%p/include/python2.3
-I%p/include/python2.3/Numeric,' GDALmake.opt.in
    perl -pi.bak -e 's,^PYTHON = \@PYTHON\@,PYTHON =
%p/bin/python2.3,' GDALmake.opt.in
    perl -pi.bak -e 's,^PY_LD_SHARED = \@PY_LD_SHARED\@,PY_LD_SHARED =
,' GDALmake.opt.in
    perl -pi.bak -e 's,^INST_PYMOD      =
\@pymoddir\@,INST_PYMOD      = %i/lib/python2.3/site-packages,'
GDALmake.opt.in

Note: %p means Fink's root (/sw in most cases) and %i means install director.

As you see, I tried to link to Fink version of Python, not System's.
Then I tried to use GDAL in Python and got an error as:

YahooBB220041001026:~ baba$ /sw/bin/python
Python 2.3.4 (#1, Mar 27 2005, 05:51:42)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap
YahooBB220041001026:~ baba$

Does it get confused with System's python or what? Any idea?

Thank you

--
BABA Yoshihiko
http://homepage.mac.com/babayoshihiko



More information about the Gdal-dev mailing list