Ticket #219 (closed enhancement: fixed)

Opened 14 months ago

Last modified 4 months ago

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

  Changed 14 months ago by jmalik

  • component changed from Documentation to Package

  Changed 13 months 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?

follow-up: ↓ 4   Changed 13 months ago by 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.

in reply to: ↑ 3   Changed 13 months 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

  Changed 13 months 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.

  Changed 13 months 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.

2. 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

3. 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).

  Changed 13 months ago by tomkralidis

  • cc tomkralidis added

  Changed 9 months 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

follow-up: ↓ 10   Changed 5 months 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.

in reply to: ↑ 9   Changed 5 months 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...

follow-up: ↓ 12   Changed 5 months 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.

in reply to: ↑ 11   Changed 5 months 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.

  Changed 5 months ago by pcav

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

follow-up: ↓ 15   Changed 4 months 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?

in reply to: ↑ 14   Changed 4 months 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.

  Changed 4 months ago by pcav

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

  Changed 4 months 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

  Changed 4 months ago by jef

  • keywords python27 added

  Changed 4 months ago by jef

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.