FS#42054 - [wxpython] wx-3.0-gtk2/wx/lib/plot.py fails to import numpy.oldnumeric

Attached to Project: Arch Linux
Opened by czk (czk) - Sunday, 21 September 2014, 19:37 GMT
Last edited by Eric Belanger (Snowman) - Tuesday, 14 October 2014, 04:03 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Eric Belanger (Snowman)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

wxpython 3.0.1.1-1 provides /usr/lib/python2.7/site-packages/wx-3.0-gtk2/wx/lib/plot.py which tries to import numpy.oldnumeric:

---
# Needs NumPy
try:
import numpy.oldnumeric as _Numeric
except:
msg= """
This module requires the NumPy module, which could not be
imported. It probably is not installed (it's not part of the
standard Python distribution). See the Numeric Python site
(http://numpy.scipy.org) for information on downloading source or
binaries."""
raise ImportError, "NumPy not found.\n" + msg
---

I was not able to find numpy.oldnumeric module in python-numpy 1.9.0-1 or any other Arch Linux Python package as of now. The error always is:

Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy.oldnumeric
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy.oldnumeric'

Python 2.7.8 (default, Jul 1 2014, 17:30:21)
[GCC 4.9.0 20140604 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy.oldnumeric
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named oldnumeric

GRASS GIS fails to launch its wxpython GUI for that.

I have python-numpy, python2-numpy and python2-numarray installed.
This task depends upon

Closed by  Eric Belanger (Snowman)
Tuesday, 14 October 2014, 04:03 GMT
Reason for closing:  Fixed
Additional comments about closing:  wxpython-3.0.1.1-2
Comment by czk (czk) - Sunday, 21 September 2014, 20:16 GMT
In /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/plot.py the following does it:

---
# Needs Numeric or numarray or NumPy
try:
import numpy.oldnumeric as _Numeric
except:
try:
import numarray as _Numeric #if numarray is used it is renamed Numeric
except:
try:
import Numeric as _Numeric
except:
msg= """
This module requires the Numeric/numarray or NumPy module,
which could not be imported. It probably is not installed
(it's not part of the standard Python distribution). See the
Numeric Python site (http://numpy.scipy.org) for information on
downloading source or binaries."""
raise ImportError, "Numeric,numarray or NumPy not found. \n" + msg
---

Could this solution be copied to python2.7/site-packages/wx-3.0-gtk2/wx/lib/plot.py?
Comment by czk (czk) - Thursday, 09 October 2014, 18:38 GMT
I think this issue essentially breaks any software which attemps to import wx.lib.plot from wxPython 3.0.

How about a patch as attached? It's a copy from wx-2.8-gtk2-unicode/wx/lib/plot.py.

Works for me, no side effects expected.

Or does it have to be fixed upstream?
Comment by czk (czk) - Thursday, 09 October 2014, 19:12 GMT
Mheh, looks like wxPython got rid of these extra checks 2 years ago [1] on purpose.

And they already know how to address the problem the right way - [2], [3]. So we have wait for their new release?

Or could Arch ship a "transition" package with numpy.oldnumeric until then?

[1] http://trac.wxwidgets.org/changeset/73237/wxPython/trunk/wx/lib/plot.py
[2] http://trac.wxwidgets.org/ticket/16590
[3] http://trac.wxwidgets.org/attachment/ticket/16425
Comment by czk (czk) - Thursday, 09 October 2014, 20:04 GMT
Me added this again. Please remove. Sorry!
Comment by czk (czk) - Monday, 13 October 2014, 19:42 GMT

Loading...