Python Support on MacOSX

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Python Support on MacOSX

BABA Yoshihiko
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
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Python Support on MacOSX

BABA Yoshihiko
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
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Python Support on MacOSX

BABA Yoshihiko
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
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Python Support on MacOSX

Sean Gillies
In reply to this post by BABA Yoshihiko
On Jun 3, 2005, at 10:44 PM, BABA Yoshihiko wrote:

> 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,

Don't hack the GDALmake.opt.in file. Everything can be accomplished
with proper use of the GDAL configure script. To specify a particular
python, do something like this

   $ ./configure [OPTIONS]... PYTHON=/sw/bin/python

Sean

--
Sean Gillies
sgillies at frii dot com
http://zcologia.com

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Python Support on MacOSX

BABA Yoshihiko
Sorry about sending the same email three times.

2005/6/4, Sean Gillies <[hidden email]>:

>
> BABA,
>
> Don't hack the GDALmake.opt.in file. Everything can be accomplished
> with proper use of the GDAL configure script. To specify a particular
> python, do something like this
>
>    $ ./configure [OPTIONS]... PYTHON=/sw/bin/python
>
> Sean

Of course, that's what I first did. After testing some compile options
with no luck, I found this webpage:
http://aspn.activestate.com/ASPN/Mail/Message/pythonmac-sig/1902289

--
BABA Yoshihiko
http://homepage.mac.com/babayoshihiko
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Python Support on MacOSX

jim hopper
In reply to this post by BABA Yoshihiko
What frank told me to do and it works fine is to use the following  
configure option

--without-libtool

by the way the gdal installer that frank put up for me for osx on his  
ftp site has python support.  i used it to run his python based test  
suite to make sure it worked correctly.

jim

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev