Fwd: Re: [gdal-dev] FWTools and GDAL 1.7.0
Jason Roberts
jason.roberts at duke.edu
Wed Jan 5 18:46:31 EST 2011
Tamas,
I have a decent amount of experience programming with Python (6 years,
develop my own extension modules, etc) and I have never seen a package that
recommends you install it to a directory of your choice and then modify the
PYTHONPATH environment variable. The standard installation location is the
"site-packages" directory. See http://www.python.org/dev/peps/pep-0250/ for
some background on that.
The GDAL team certainly could publish instructions that said "copy the
release-1500-dev\gdal\swig\python\*.py and the osgeo subdirectory directory
to a location of your choice and modify set the PYTHONPATH environment
variable to include that location" but it would be very unusual. GDAL would
likely be the only package that the user encounters with those instructions.
The PYTHONPATH environment variable would likely not even be defined
already. (Although if they have ArcGIS, it would be, because ArcGIS includes
some Python extensions that live in the ArcGIS installation dir.)
So, in sum, you could make PYTHONPATH your official solution but it would be
weird. The more traditional route would be to modify the GDAL build scripts
to invoke the existing setup.py with the arguments "bdist --formats=wininst"
to build a Windows installation package (see
http://docs.python.org/distutils/builtdist.html). Ideally, it would also
include a post-install script that could install the GDAL binaries somewhere
(such as a subdir inside \PythonXX\Lib\site-packages\gdal) and set PATH,
PROJ_LIB, GDAL_DRIVER_PATH, and GDAL_DATA to the correct things. I could
potentially help you develop that. It looks like most of what is needed is
already there.
Jason
From: Tamas Szekeres [mailto:szekerest at gmail.com]
Sent: Wednesday, January 05, 2011 6:12 PM
To: Jason Roberts
Cc: gdal-dev at lists.osgeo.org; Christopher Barker
Subject: Re: Fwd: Re: [gdal-dev] FWTools and GDAL 1.7.0
2011/1/5 Jason Roberts <jason.roberts at duke.edu>
Right now, to install the latest GDAL for Python on Windows, the user has to
download a zip file from http://vbkto.dyndns.org/sdk/, drill in to find the
Python files, copy them to C:\PythonXX\Lib\site-packages, drill into find
the GDAL binaries and related files, copy them to a directory such as
C:\GDAL, set the PATH and GDAL environment variables, and so on. And there
are no obvious instructions anywhere about how to do this. Python
programmers are programmers after all, so they can generally figure that out
and accomplish it. But it is not what they are used to doing if they are a
Windows programmer. This is why Chris basically says that he has to remember
/ relearn how to do it every time he upgrades GDAL.
It would be really helpful to Windows Python programmers who want to use
GDAL-probably a large number of potential GDAL users-for the GDAL team to
offer installation via one or both of the mechanisms I mentioned above.
Jason,
Maybe this is due to my lack of knowledge in Python, but why is it a
requirement to place the files to such specific locations to run a python
app with gdal on Windows? As far as I remember setting up the following
environment variables properly (in a command prompt) does the right thing
from arbitrary locations (at least when running the autotest suite for
GDAL):
PROJ_LIB
GDAL_DRIVER_PATH
GDAL_DATA
PYTHONPATH
PATH
Certainly one should find out the location of the python.exe which might
also be included in PATH for convenience.
Best regards,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110105/19558a93/attachment.html
More information about the gdal-dev
mailing list