Numpy version in openSUSE

Not sure where to post this but this is an issue for numeric Python programmers.

I wonder why the standard openSUSE 12.3 OSS repo contains a now-obsolete version of python-numpy (1.6.2) that is
included in every default openSUSE install. The version in the science repo (1.7.1) is not only much more up to date but
ensures compatibility with related packages (notably matplotlib). I’m well aware there’s nothing to stop users upgrading
themselves, but I’ve already seen a number of people stumble on this apparent anomaly.

Did you file a bugreport for this? If it’s a showstopper for python programmers, an update could be done through the Update repo.

Knurpht wrote:
> flymail;2559217 Wrote:
>> Not sure where to post this but this is an issue for numeric Python
>> programmers.
>>
>> I wonder why the standard openSUSE 12.3 OSS repo contains a
>> now-obsolete version of python-numpy (1.6.2) that is
>> included in every default openSUSE install. The version in the science
>> repo (1.7.1) is not only much more up to date but
>> ensures compatibility with related packages (notably matplotlib). I’m
>> well aware there’s nothing to stop users upgrading
>> themselves, but I’ve already seen a number of people stumble on this
>> apparent anomaly.
>
> Did you file a bugreport for this? If it’s a showstopper for python
> programmers, an update could be done through the Update repo.

What, if anything, depends on that package? Perhaps there’s some system
script that uses it.

I already thought about that. Wouldn’t it be strange if the package served in http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.3/ would break the system? It should at least complain when installing from this repo, wouldn’t it?

Edit: the python-numpy package version in mentioned repo is 1.7.1

On 2013-05-22, Knurpht <Knurpht@no-mx.forums.opensuse.org> wrote:
> Edit: the python-numpy package version in mentioned repo is 1.7.1

I have the default openSUSE 12.3_i586_LXDE install on a kvm virtual machine and have applied all the updates. If you
don’t believe me:


linux-2s7a:~ # zypper lr -d
# | Alias                     | Name                               | Enabled | Refresh | Priority | Type   | URI                                                              | Service
--+---------------------------+------------------------------------+---------+---------+----------+--------+------------------------------------------------------------------+--------
1 | openSUSE-12.3-1.7         | openSUSE-12.3-1.7                  | Yes     | No      |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00001,/dev/sr0 |
2 | repo-debug                | openSUSE-12.3-Debug                | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/distribution/12.3/repo/oss/   |
3 | repo-debug-update         | openSUSE-12.3-Update-Debug         | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3/                  |
4 | repo-debug-update-non-oss | openSUSE-12.3-Update-Debug-Non-Oss | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3-non-oss/          |
5 | repo-non-oss              | openSUSE-12.3-Non-Oss              | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/non-oss/     |
6 | repo-oss                  | openSUSE-12.3-Oss                  | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/oss/         |
7 | repo-source               | openSUSE-12.3-Source               | No      | Yes     |   99     | NONE   | http://download.opensuse.org/source/distribution/12.3/repo/oss/  |
8 | repo-update               | openSUSE-12.3-Update               | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3/                        |
9 | repo-update-non-oss       | openSUSE-12.3-Update-Non-Oss       | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3-non-oss/                |
linux-2s7a:~ # zypper info python-numpy
Loading repository data...
Reading installed packages...


Information for package python-numpy:

Repository: openSUSE-12.3-Oss
Name: python-numpy
Version: 1.6.2-10.1.1
Arch: i586
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 9.0 MiB
Summary: NumPy array processing for numbers, strings, records and objects
Description:
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays.  NumPy is built on the Numeric code base and adds features
introduced by numarray as well as an extended C-API and the ability to
create arrays of arbitrary type which also makes NumPy suitable for
interfacing with general-purpose data-base applications.
There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.

linux-2s7a:~ # zypper in python-numpy
Loading repository data...
Reading installed packages...
'python-numpy' is already installed.
No update candidate for 'python-numpy-1.6.2-10.1.1.i586'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.
linux-2s7a:~


Both the Python and Science repos report python-numpy 1.7.1 whereas the standard OSS offers only version 1.6.2 (32 and
64 bit).

On 2013-05-22, Dave Howorth <djh-novell@no-mx.forums.opensuse.org> wrote:
> What, if anything, depends on that package? Perhaps there’s some system
> script that uses it.

The openSUSE 12.3 OSS repo contains numpy 1.6.2 and matplotlib 1.2.0. I suppose I’m trying to point out this is
inconsistent within the OSS repository because matplotlib 1.2.0 is only compatible with numpy versions 1.7.x.

Am 22.05.2013 18:57, schrieb flymail:
> inconsistent within the OSS repository because matplotlib 1.2.0 is only compatible with numpy versions 1.7.x.

that is completely new for me, since to my knowledge matplotlib 1.2 is
compatible with numpy 1.6, but I am sure you can give an authoritative
reference that matplotlib 1.2 requires numpy 1.7.x


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.3 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

On 2013-05-22, Knurpht <Knurpht@no-mx.forums.opensuse.org> wrote:
> Did you file a bugreport for this? If it’s a showstopper for python
> programmers, an update could be done through the Update repo.

No I haven’t: I didn’t know if it qualified as a bug. My concern was whether there are dependencies within openSUSE on
having an obsolete version of numpy that could explain the persistence of version 1.6.2. I suspect there may not,
because on my host (not virtual) machine on this box, I’m using 1.7.1 and the computer hasn’t yet exploded.

On 2013-05-22, Martin Helm <martin_helm@no-mx.forums.opensuse.org> wrote:
> Am 22.05.2013 18:57, schrieb flymail:
>> inconsistent within the OSS repository because matplotlib 1.2.0 is only compatible with numpy versions 1.7.x.
>
> that is completely new for me, since to my knowledge matplotlib 1.2 is
> compatible with numpy 1.6, but I am sure you can give an authoritative
> reference that matplotlib 1.2 requires numpy 1.7.x

If you’re compiling from source, matplotlib is happy with numpy versions as old as 1.4. But the binary installation in
the OSS repo was compiled against 1.7.x. This is what happens if you install both packages from the OSS repo:


sh-4.2$ python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as mp
RuntimeError: module compiled against API version 7 but this version of numpy is 6
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
from matplotlib.figure import Figure, figaspect
File "/usr/lib/python2.7/site-packages/matplotlib/figure.py", line 24, in <module>
import matplotlib.artist as martist
File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", line 7, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, \
File "/usr/lib/python2.7/site-packages/matplotlib/transforms.py", line 35, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: numpy.core.multiarray failed to import
>>>

Am 22.05.2013 19:20, schrieb flymail:
> If you’re compiling from source, matplotlib is happy with numpy versions as old as 1.4.
Exactly, that is what the matplotlib site refers to, so I misunderstood
what you meant

> But the binary installation in
> the OSS repo was compiled against 1.7.x. This is what happens if you install both packages from the OSS repo:
that is really a bug! a packaging bug, you should report it
it has to be compiled against the numpy version shipped in OSS of course

I never notice such things since I never run my systems with the vanilla
packages for numpy, scipy, matplotlib and so on (and obviously you also
not and most other people doing development with numpy and friends, so
it went unnoticed)


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.3 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

On 2013-05-22, Martin Helm <martin_helm@no-mx.forums.opensuse.org> wrote:
> that is really a bug! a packaging bug, you should report it
> it has to be compiled against the numpy version shipped in OSS of course

Done (#821243).

Are you sure you haven’t just mixed up the packages?

I just installed python-matplotlib from the OSS repo and I don’t get that API version error. (I get another error though)

wolfi@amiga:~> rpm -q python-numpy python-matplotlib
python-numpy-1.6.2-10.1.1.x86_64
python-matplotlib-1.2.0-2.1.1.x86_64
wolfi@amiga:~> python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as mp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 97, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
    globals(),locals(),[backend_name])
ImportError: No module named backend_tkagg
>>>

Technically it’s quite impossible that python-matplotlib from OSS got built against a python-numpy from a different repo.

OK, installed python-matplotlib-tk (also from OSS) and now it works fine here:

wolfi@amiga:~> rpm -q python-numpy python-matplotlib python-numpy-1.6.2-10.1.1.x86_64
python-matplotlib-1.2.0-2.1.1.x86_64
wolfi@amiga:~> python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as mp
>>> 

So I guess you should close your bugreport again. :wink:

On 2013-05-22, wolfi323 <wolfi323@no-mx.forums.opensuse.org> wrote:
> So I guess you should close your bugreport again. :wink:
>
Please output:


sh-4.2$ zypper info python-numpy python-matplotlib

and then we’ll see.

Here you are:

wolfi@amiga:~> zypper info python-numpy python-matplotlib
Daten des Repositories laden ...
Installierte Pakete lesen ...


Informationen für Paket python-numpy:

Repository: openSUSE-12.3
Name: python-numpy
Version: 1.6.2-10.1.1
Arch: x86_64
Anbieter: openSUSE
Installiert: Ja
Status: aktuell
Installierte Größe: 9,0 MiB
Zusammenfassung: NumPy array processing for numbers, strings, records and objects
Beschreibung: 
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays.  NumPy is built on the Numeric code base and adds features
introduced by numarray as well as an extended C-API and the ability to
create arrays of arbitrary type which also makes NumPy suitable for
interfacing with general-purpose data-base applications.
There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.

Informationen für Paket python-matplotlib:

Repository: openSUSE-12.3
Name: python-matplotlib
Version: 1.2.0-2.1.1
Arch: x86_64
Anbieter: openSUSE
Installiert: Ja
Status: aktuell
Installierte Größe: 51,4 MiB
Zusammenfassung: Plotting Library for Python
Beschreibung: 
matplotlib is a python 2D plotting library which produces publication
quality figures in a variety of hardcopy formats and interactive
environments across platforms. matplotlib can be used in python
scripts, the python and ipython shell (ala matlab or mathematica), web
application servers, and six graphical user interface toolkits.
wolfi@amiga:~> 

And now yours? :wink:

On 2013-05-22, wolfi323 <wolfi323@no-mx.forums.opensuse.org> wrote:
> And now yours? :wink:

Thank you for posting the info; I’ve already posted mine (see post #5) :). Unlike mine however, your repo is not
openSUSE-12.3-Oss (the default for Oss), and so I will not close the bug report. It would be interesting to see the
contents of your `zypper lr -d’, to see where your python-numpy did come from.

flymail wrote:
> On 2013-05-22, wolfi323 <wolfi323@no-mx.forums.opensuse.org> wrote:
>> And now yours? :wink:
>
> Thank you for posting the info; I’ve already posted mine (see post #5) :). Unlike mine however, your repo is not
> openSUSE-12.3-Oss (the default for Oss), and so I will not close the bug report. It would be interesting to see the
> contents of your `zypper lr -d’, to see where your python-numpy did come from.

I’m no Python expert, but it does seem to me that there is some
packaging error here that ought to be fixed. But it isn’t clear at least
to me exactly what the error is*. So I’d suggest concentrating on
diagnosing exactly what the problem is (or stating the problem precisely
if you believe you understand it), whilst trying to reduce the
non-technical content of the exchange.

I should say that I’m replying to flymail’s message, because I have to
reply to some message, but my comments are aimed at everybody, not just
flymail.

In regard to this particular message, AIUI the repo name displayed in
the zypper info is an arbitrary string, so the fact that people have
different strings is not too surprising, but it would be useful to see
the zypper lr -d to confirm the mapping to URLs.

*Why does installing python-matplotlib-tk make a difference, for
example? And since it does, why wasn’t it a dependency for one of the
other packages?

Am 23.05.2013 10:48, schrieb Dave Howorth:
> *Why does installing python-matplotlib-tk make a difference, for
> example? And since it does, why wasn’t it a dependency for one of the
> other packages?

matplotlib as such does not need to have a gui backend installed, you
can change the config and use it without any of the gui interfaces (for
example in web scripts or to produce graphic files in script running
headless) so it makes sense that you can install it without pulling in
the corresponding optional tk or qt4 backend.
It is the other way round, if you want a gui install one of the
matplotlib gui packages and it will pull in the matplotlib core package.

That it throws an error message when importing it just is a consequence
that as vanilla config the tk backend is set (change it from TkAgg to
Agg and you should not get an error).

Maybe one can discuss if TkAgg is a proper default as the tk backend is
not installed by default (which is a good choice), but I expect a python
developer to be able to change a config file for a package used to fit
the needs.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.3 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

On 2013-05-23, Martin Helm <martin_helm@no-mx.forums.opensuse.org> wrote:
> Maybe one can discuss if TkAgg is a proper default as the tk backend is
> not installed by default (which is a good choice), but I expect a python
> developer to be able to change a config file for a package used to fit
> the needs.

Even though I concede your assertion is consistent with purist UNIX principles, I not sure I agree with you in practice
since Tk is the default choice on the standard matplotlib API and >95% of the normal use of matplotlib requires
tk/wx/qt. You might expect a python developer to change the config files, but most scientific programmers (who comprise
the majority of matplotlib users) are not really developers and you will leave them stymied. But this is of course a
separate issue to the one I’ve raised above.

Am 23.05.2013 11:33, schrieb flymail:
> since Tk is the default choice on the standard matplotlib API and >95% of the normal use of matplotlib requires
> tk/wx/qt.
the gui packages could be recommended (not required) by the installation
of matplotlib that will install them for that majority of users in an
automatic way

of course that is a different issue, it is more a usability question


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.3 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500