Opened 9 years ago

Closed 8 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 Changed 9 years ago by jmalik

Component: DocumentationPackage

comment:2 Changed 8 years ago by warmerdam

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 Changed 8 years ago by Mike Toews

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.

comment:4 in reply to:  3 Changed 8 years ago by martinl

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 Changed 8 years ago by maphew

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

comment:6 Changed 8 years ago by maphew

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 Changed 8 years ago by tomkralidis

Cc: tomkralidis added

comment:8 Changed 8 years ago by sharpie

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 Changed 8 years ago by pcav

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.

comment:10 in reply to:  9 Changed 8 years ago by martinl

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 Changed 8 years ago by 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.

comment:12 in reply to:  11 Changed 8 years ago by martinl

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 Changed 8 years ago by pcav

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

comment:14 Changed 8 years ago by 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?

comment:15 in reply to:  14 Changed 8 years ago by jef

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 Changed 8 years ago by pcav

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

comment:17 Changed 8 years ago by neteler

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 Changed 8 years ago by jef

Keywords: python27 added

comment:19 Changed 8 years ago by jef

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