Opened 13 years ago

Closed 12 years ago

#219 closed enhancement (fixed)

Upgrade python version

Reported by: jmalik Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords: python python27
Cc: warmerdam, tomkralidis

Description

the current python version shipped with osgeo4w is 2.5.

the Orfeo Toolbox library dependencies are all fullfilled by OSGeo4w, except that the python version 2.5 is too old to compile the OTB-Wrapping project (http://hg.orfeo-toolbox.org/OTB-Wrapping/), which provides Python and Java wrappers for the library.

Version 2.7 is known to work. Version 2.6 might be sufficient, but I would have to test.

Can the python package be upgraded to a newer version ?

Change History (19)

comment:1 by jmalik, 13 years ago

Component: DocumentationPackage

comment:2 by warmerdam, 13 years ago

Cc: warmerdam added
Keywords: python added

I will note that it will be challenging to coordinate upgrading all python components to a new version of Python. Is it really not possible to fix up the OTB wrappers to work with 2.5?

comment:3 by Mike Taves, 13 years ago

FWIW, Python 2.7 is the last release of the 2.x series, and will be maintained for a longer period than previous versions (expected to be more than two years).

http://docs.python.org/release/2.7/whatsnew/2.7.html#the-future-for-python-2-x

As I expect the 2.x series (rather than 3.x) to be the dominant platform for a while longer, Python 2.7 is a realistic target to meet.

I just had a quick look at the scope of the Python packages in OSGeo4w, and on the upstream side they all appear to be "2.7 ready", so there aren't any serious obstacles. I'm interested in helping coordinate a transition, if any distributed help is needed.

in reply to:  3 comment:4 by martinl, 13 years ago

Replying to mwtoews:

FWIW, Python 2.7 is the last release of the 2.x series, and will be maintained for a longer period than previous versions (expected to be more than two years).

http://docs.python.org/release/2.7/whatsnew/2.7.html#the-future-for-python-2-x

As I expect the 2.x series (rather than 3.x) to be the dominant platform for a while longer, Python 2.7 is a realistic target to meet.

I just had a quick look at the scope of the Python packages in OSGeo4w, and on the upstream side they all appear to be "2.7 ready", so there aren't any serious obstacles. I'm interested in helping coordinate a transition, if any distributed help is needed.

Agreed & +1 for upgrading to python 2.7 see also #214

comment:5 by maphew, 13 years ago

I created RequiresPython page to track which packages need work, are ready, or can be forgotten about. Please feel free to update.

comment:6 by maphew, 13 years ago

I've built a python 2.7 package for testing, while osgeo.org is down you can fetch it here: http://files.environmentyukon.ca/matt/python-2.7.1-1.tar.bz2

It *REPLACES* the existing python2.5 files:

.\bin\python.exe .\bin\pythonw.exe .\bin\w9xpopen.exe .\etc\ini\python.bat

So make a backup of these 4 files if you're testing in an existing install. Everything else is untouched (e.g. .\apps\python25).

To use, unpack from %osgeo4w_root%.


My install and testing procedure:

  1. Download standalone apt from http://code.google.com/p/maphew/downloads/list and place in PATH as apt.exe.
  1. Open command shell and
    set osgeo4w_root=c:\o4w_py27
    apt setup
    
    :: to share cache with existing install 
    :: and avoid needless downloads
    REM copy c:\osgeo4w\etc\setup\last-cache %osgeo4w_root%\etc\setup\
    
    apt install shell
    
    :: install py27 testing package, assumes 7zip in path
    pushd %osgeo4w_root%
    7z x python-2.7.1-1.tar.bz2
    7z x python-2.7.1-1.tar
    
  1. Run osgeo4w.bat

You now have a minimal osgeo4w install with just shell and python 2.7. Use apt to install other packages and see what works/breaks.

Remember to open a new OSGeo4W shell after installing (or run the batch files in .\etc\ini manually).

comment:7 by tomkralidis, 13 years ago

Cc: tomkralidis added

comment:8 by sharpie, 13 years ago

Another +1 to upgrading the Python version. Many useful modules that are striving for an easy transition to Python 3 are dropping support for Python versions older than 2.6.

Pre-compiled binaries for Windows that support Python 2.5 are starting to die out:

http://www.lfd.uci.edu/~gohlke/pythonlibs

comment:9 by pcav, 12 years ago

Are there any news about this? What is the mains stumbling block? This is preventing nice improvements, such as the SAGA and OTB QGIS plugins, to be usable for Windows users. I'm available to support the work.

in reply to:  9 comment:10 by martinl, 12 years ago

Replying to pcav:

Are there any news about this? What is the mains stumbling block? This is preventing nice

probably wxpython package. I hope to have some time for that during Christmas holidays...

comment:11 by pcav, 12 years ago

Thanks. Could we keep two versions for the time being, 2.5 for wxpy and 2.7 for the rest? I now it's messy, but at least we can move forward. Thanks.

in reply to:  11 comment:12 by martinl, 12 years ago

Replying to pcav:

Thanks. Could we keep two versions for the time being, 2.5 for wxpy and 2.7 for the rest? I now it's messy, but at least we can move forward. Thanks.

my very personal opinion: I would prefer to update wxpython first and to move forward.

comment:13 by pcav, 12 years ago

It is certainly the best option, provided it can realistically be done soon.

comment:14 by brushtyler, 12 years ago

In QGis the tool named Clipper doesn't work on WinOS due to a bug in python 2.5 (see #4676).

How is the wxpython upgrade going? Any news?

in reply to:  14 comment:15 by jef, 12 years ago

Replying to brushtyler:

In QGis the tool named Clipper doesn't work on WinOS due to a bug in python 2.5 (see #4676).

How is the wxpython upgrade going? Any news?

I repacked the binaries from wxpython.org. Apparently the demos work.

comment:16 by pcav, 12 years ago

So now only GRASS is missing, right? Is it necessary to recompile it?

comment:17 by neteler, 12 years ago

From the list:

On Tue, Jan 17, 2012 at 5:57 PM, Martin Landa <landa.martin@gmail.com> wrote:
> 2012/1/17 Martin Landa <landa.martin@gmail.com>:
>> AFAIU no need to rebuild GRASS.
>
> well, GRASS buiding system also generates `compiled` python files.
> Anyway there is no blocker from GRASS side. Go ahead with python
> version upgrade...
>
> Martin

comment:18 by jef, 12 years ago

Keywords: python27 added

comment:19 by jef, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.