[Numpy-discussion] Corrupted installation?

Nathaniel Smith njs at pobox.com
Tue Jul 3 12:00:44 EDT 2018

On Tue, Jul 3, 2018, 05:01 Tom Cook <tom.k.cook at gmail.com> wrote:

> I have a remote sensing platform that uses Numpy on a raspberry pi.  There
> are about a dozen of these installed.  Three days ago, the Python part of
> the software started crashing during startup, with this exception message:
> Traceback (most recent call last):
>   File "/home/azi/board/sensor_logger.py", line 16, in <module>
>     from board.measurement.data import Expression, MeasurementData
>   File "/home/azi/board/measurement/data.py", line 2, in <module>
>     import numpy as np
>   File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 153, in
> <module>
>     from . import add_newdocs
>   File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in
> <module>
>     from numpy.lib import add_newdoc
>   File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in
> <module>
>     from .type_check import *
>   File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11,
> in <module>
>     import numpy.core.numeric as _nx
>   File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 7, in
> <module>
>     from . import umath
> SystemError: initialization of umath raised unreported exception

And the C level, reporting an exception to the python interpreter involves
two steps: (1) stashing the exception object in a special global variable
where the interpreter knows to look for it, (2) returning a special value
(usually -1 or NULL) that tells the interpreter an exception has been
raised and it should go look at that global variable for more details.

I *think* that error means that the umath initialization routine did step
(1), but not step (2), and the interpreter is cranky because it doesn't
know how to interpret this. (Unfortunately I don't have a copy of py34 on
my phone to confirm...)

If that's correct, though, then probably the next thing you want to do is
figure out what exception is being set, since that's likely to be the real
error. It's annoying that python doesn't tell you. It should be possible to
dig around with gdb and figure it out, but will require some knowledge of
the python C API and gdb and I don't know the recipe offhand.

Are you having the same problem on all the installations?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180703/1155f1b7/attachment.html>

More information about the NumPy-Discussion mailing list