Bug 188382 - graphics/mypaint fails to run: ImportError: numpy.core.multiarray failed to import
Summary: graphics/mypaint fails to run: ImportError: numpy.core.multiarray failed to i...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jan Beich
Depends on: 193429 193434
  Show dependency treegraph
Reported: 2014-04-08 22:50 UTC by yedderson
Modified: 2015-01-28 13:43 UTC (History)
1 user (show)

See Also:

build log with both patches applied (228.89 KB, text/plain)
2014-09-07 18:01 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description yedderson 2014-04-08 22:50:00 UTC
Mypaint fails to run with the error below
Comment 1 Edwin Groothuis freebsd_committer 2014-04-10 04:38:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Jan Beich freebsd_committer 2014-09-07 17:03:25 UTC
It appears the port needs same DT_RPATH as py-numpy.
Comment 3 Jan Beich freebsd_committer 2014-09-07 18:01:40 UTC
Created attachment 147021 [details]
build log with both patches applied

mypaint now starts fine inside poudriere jail but there's a warning about missing icon in the default gtk theme.

$ mypaint
Using GTK2
builtin python 2.6 json support
DEBUG: getlocale(): (None, None)
DEBUG: localepath:  /usr/local/share/locale
DEBUG: localepath_brushlib:  /usr/local/share/locale
confpath = /home/foo/.mypaint/
Created /home/foo/.mypaint/
Created /home/foo/.mypaint/backgrounds
Created /home/foo/.mypaint/brushes
Created /home/foo/.mypaint/scratchpads
DEBUG: mode stack updated: <ModeStack [SwitchableFreehandMode]>
Merging upstream brush changes into your collection.
Traceback (most recent call last):
  File "/usr/local/share/mypaint/gui/toolbar.py", line 755, in on_size_allocate
  File "/usr/local/share/mypaint/gui/toolbar.py", line 776, in _update
    scaled_pixbuf = self._get_scaled_pixbuf(s)
  File "/usr/local/share/mypaint/gui/toolbar.py", line 760, in _get_scaled_pixbuf
    return theme.load_icon(gtk.STOCK_MISSING_IMAGE, size, 0)
glib.GError: Icon 'gtk-missing-image' not present in theme
Looking for GTK devices with pressure:

No pressure sensitive devices found.
Comment 4 Dmitry Marakasov freebsd_committer 2014-09-11 14:13:04 UTC
I've released maintainership of mypaint, release the PR as well.
Comment 5 John Marino freebsd_committer 2014-09-12 06:27:59 UTC
move this out of triage to "open", (a.k.a. "limbo")
Comment 6 Jan Beich freebsd_committer 2015-01-28 11:19:50 UTC
Bugzilla conversion ate comment 0 while comment 2 failed to provide an example. Without same RPATH as py-numpy runtime linker loads old libgcc_s first which leads to:

$ pkg info -l mypaint | fgrep .so | xargs readelf -d | fgrep gcc_s
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]

$ LD_PRELOAD=/lib/libgcc_s.so.1 python -c 'import numpy'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 170, in <module>
    from . import add_newdocs
  File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module>
    from .polynomial import *
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module>
    from numpy.linalg import eigvals, lstsq, inv
  File "/usr/local/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
    from .linalg import *
  File "/usr/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module>
    from numpy.linalg import lapack_lite, _umath_linalg
ImportError: /usr/lib/libgcc_s.so: version GCC_4.6.0 required by /usr/local/lib/gcc49/libgfortran.so.3 not found

$ LD_PRELOAD=/lib/libgcc_s.so.1 mypaint
ImportError: numpy.core.multiarray failed to import

We are not correctly installed or compiled!
script: "/usr/local/bin/mypaint"
deduced prefix: "/usr/local"
lib_shared: "/usr/local/share/mypaint/"
lib_compiled: "/usr/local/lib/mypaint/"

Traceback (most recent call last):
  File "/usr/local/bin/mypaint", line 170, in <module>
    datapath, extradata, confpath, localepath, localepath_brushlib = get_paths()
  File "/usr/local/bin/mypaint", line 111, in get_paths
    from lib import mypaintlib
  File "/usr/local/share/mypaint/lib/mypaintlib.py", line 25, in <module>
    _mypaintlib = swig_import_helper()
  File "/usr/local/share/mypaint/lib/mypaintlib.py", line 17, in swig_import_helper
    import _mypaintlib
ImportError: numpy.core.multiarray failed to import
Comment 7 commit-hook freebsd_committer 2015-01-28 13:40:34 UTC
A commit references this bug:

Author: jbeich
Date: Wed Jan 28 13:39:42 UTC 2015
New revision: 378057
URL: https://svnweb.freebsd.org/changeset/ports/378057

  Build using lang/gcc* to avoid runtime issues with old -lgcc_s or Clang

  Absence of RPATH leads to mypaint loading old libgcc_s.so.1 from base
  first which later breaks |import numpy| as libgfortran wants newer version.
  On 10.0+ the issue is masked by Clang failing to instantiate some templates.

  PR:		188382
  PR:		193429
  Differential Revision:	https://reviews.freebsd.org/D1616
  Approved by:	bapt (mentor)