Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 648960

Summary: media-gfx/mypaint-1.2.1: ImportError: No module named _mypaintlib
Product: Gentoo Linux Reporter: lekto
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: casta, tsmksubc
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/9337
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 506276    
Attachments: emerge --info

Description lekto 2018-02-27 17:05:34 UTC
lekto@blaszak ~ $ mypaint
INFO: mypaint: Installation layout: conventional POSIX-like structure with prefix u'/usr'
INFO: lib.i18n: POSIX: LANG='en_US.utf8'
INFO: lib.i18n: POSIX: LANGUAGE=None
Traceback (most recent call last):
  File "/usr/bin/mypaint", line 464, in <module>
    main.main(datapath, iconspath, old_confpath, version=version)
  File "/usr/share/mypaint/gui/main.py", line 95, in main
    from gui import application
  File "/usr/share/mypaint/gui/application.py", line 48, in <module>
    import lib.document
  File "/usr/share/mypaint/lib/document.py", line 37, in <module>
    import lib.helpers as helpers
  File "/usr/share/mypaint/lib/helpers.py", line 26, in <module>
    import mypaintlib
  File "/usr/share/mypaint/lib/mypaintlib.py", line 17, in <module>
    _mypaintlib = swig_import_helper()
  File "/usr/share/mypaint/lib/mypaintlib.py", line 16, in swig_import_helper
    return importlib.import_module('_mypaintlib')
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _mypaintlib

lekto@blaszak ~ $ emerge -pv mypaint libmypaint 

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-libs/libmypaint-1.3.0::gentoo  USE="gegl nls openmp -introspection" 428 KiB
[ebuild   R    ] media-gfx/mypaint-1.2.1::gentoo  PYTHON_TARGETS="python2_7" 37,009 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 37,437 KiB
Comment 1 lekto 2018-02-27 17:06:51 UTC
Created attachment 521238 [details]
emerge --info
Comment 2 lekto 2018-02-28 17:17:03 UTC
Looks like _mypaintlib.so is in wrong directory, dirty fix:
cp /usr/lib64/mypaint/_mypaintlib.so /usr/lib64/python2.7/
Comment 3 Jack MacNaught 2018-04-26 09:24:09 UTC
had exact same issue, the dirty fix worked for me

emerge --info

Portage 2.3.24 (python 3.5.4-final-0, default/linux/amd64/17.1/desktop/gnome/systemd, gcc-6.4.0, glibc-2.25-r11, 4.14.28-gentoo x86_64)
=================================================================
System uname: Linux-4.14.28-gentoo-x86_64-Intel-R-_Core-TM-_i7-5820K_CPU_@_3.30GHz-with-gentoo-2.4.1
KiB Mem:    65937380 total,  61374584 free
KiB Swap:     524284 total,    524284 free
Timestamp of repository gentoo: Mon, 16 Apr 2018 15:30:01 +0000
Head commit of repository gentoo: 966ca473a5ceb8e6bb268b7e2bf5eb0af3b9556e
Head commit of repository steam-overlay: 46d2624c5f248bf28e25c25e172e60c2eb988e5f

sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.10.3-r3::gentoo, 1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r11::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: no

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

axs
    location: /var/lib/layman/axs
    masters: gentoo
    priority: 50

fordfrog
    location: /var/lib/layman/fordfrog
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

steam-overlay
    location: /usr/local/portage/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

vifino-overlay
    location: /var/lib/layman/vifino-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 apache2 avahi avi berkdb bitmap-fonts bluetooth bluray branding bzip2 cairo cdda cdr cli colord crypt cups cxx dbus divx4linux dri dts dv dvd dvdr dvdread eds emboss encode evdev evo exif fam fame flac foomaticdb fortran fuse gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gtk3 iconv id3tag introspection ipv6 java jpeg lcms ldap libnotify libsecret lm_sensors mad matroska mime mmx mng modules mp3 mp4 mpeg mtp multilib nautilus ncurses nls nptl nsplugin ogg opencl opengl openh264 openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support qt5 quicktime readline samba schroedinger sdl seccomp spell sse sse2 ssl startup-notification subtitles svg systemd taglib tcpd theora tiff tk tracker truetype truetype-fonts type1-fonts udev udisks unicode upnp upower usb uvm vaapi vdpau vorbis webgl wxwidgets x264 x265 xattr xcb xine xinerama xml xv xvid xvmc zlib" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev wacom" KERNEL="linux" L10N="en-GB uk" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Pacho Ramos gentoo-dev 2018-07-24 10:21:09 UTC
media-gfx/mypaint-1.2.1 works fine for me with media-libs/libmypaint-1.3.0, please retry
Comment 5 lekto 2018-07-24 12:54:01 UTC
lekto@blaszak ~ $ sudo rm /usr/lib64/python2.7/_mypaintlib.so 
Password: 
lekto@blaszak ~ $ mypaint
INFO: mypaint: Installation layout: conventional POSIX-like structure with prefix u'/usr'
INFO: lib.i18n: POSIX: LANG='en_US.utf8'
INFO: lib.i18n: POSIX: LANGUAGE=None
Traceback (most recent call last):
  File "/usr/bin/mypaint", line 464, in <module>
    main.main(datapath, iconspath, old_confpath, version=version)
  File "/usr/share/mypaint/gui/main.py", line 95, in main
    from gui import application
  File "/usr/share/mypaint/gui/application.py", line 48, in <module>
    import lib.document
  File "/usr/share/mypaint/lib/document.py", line 37, in <module>
    import lib.helpers as helpers
  File "/usr/share/mypaint/lib/helpers.py", line 26, in <module>
    import mypaintlib
  File "/usr/share/mypaint/lib/mypaintlib.py", line 17, in <module>
    _mypaintlib = swig_import_helper()
  File "/usr/share/mypaint/lib/mypaintlib.py", line 16, in swig_import_helper
    return importlib.import_module('_mypaintlib')
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _mypaintlib
lekto@blaszak ~ $ emerge -pvO mypaint libmypaint 

These are the packages that would be merged, in order:

[ebuild   R    ] media-gfx/mypaint-1.2.1::gentoo  PYTHON_TARGETS="python2_7" 37,009 KiB
[ebuild   R    ] media-libs/libmypaint-1.3.0::gentoo  USE="gegl nls openmp -introspection" 428 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 37,437 KiB
lekto@blaszak ~ $ qcheck mypaint libmypaint
Checking media-gfx/mypaint-1.2.1 ...
  * 1196 out of 1196 files are good
Checking media-libs/libmypaint-1.3.0 ...
  * 130 out of 130 files are good
Comment 6 Guillaume Castagnino 2018-07-24 13:45:23 UTC
This is a problem with libdir in fact.
My system is migrated to the new multilib way ('no SYMLINK_LIB' with 17.1 experimental profile), and I have the issue.

A fix would be this patch, instead of moving _mypaintlib.so:

--- /usr/bin/mypaint.orig       2018-07-24 15:40:58.710096940 +0200
+++ /usr/bin/mypaint    2018-07-24 15:40:16.766926517 +0200
@@ -166,7 +166,7 @@
     if os.path.exists(libpath) and os.path.exists(iconspath):
         # This is a normal POSIX-like installation.
         # The Windows standalone distribution works like this too.
-        libpath_compiled = join(prefix, 'lib', 'mypaint')  # or lib64?
+        libpath_compiled = join(prefix, 'lib64', 'mypaint')  # or lib64?
         sys.path.insert(0, libpath)
         sys.path.insert(0, libpath_compiled)
         sys.path.insert(0, join(prefix, 'share'))  # for libmypaint



So the issue should go around multilib support.
Comment 7 Guillaume Castagnino 2018-07-24 13:46:34 UTC
It seems that all people here encountering the bug are running the 17.1 profile
Comment 8 lekto 2018-07-24 17:15:13 UTC
(In reply to Guillaume Castagnino from comment #6)
> This is a problem with libdir in fact.
> My system is migrated to the new multilib way ('no SYMLINK_LIB' with 17.1
> experimental profile), and I have the issue.
> 
> A fix would be this patch, instead of moving _mypaintlib.so:
> 
> --- /usr/bin/mypaint.orig       2018-07-24 15:40:58.710096940 +0200
> +++ /usr/bin/mypaint    2018-07-24 15:40:16.766926517 +0200
> @@ -166,7 +166,7 @@
>      if os.path.exists(libpath) and os.path.exists(iconspath):
>          # This is a normal POSIX-like installation.
>          # The Windows standalone distribution works like this too.
> -        libpath_compiled = join(prefix, 'lib', 'mypaint')  # or lib64?
> +        libpath_compiled = join(prefix, 'lib64', 'mypaint')  # or lib64?
>          sys.path.insert(0, libpath)
>          sys.path.insert(0, libpath_compiled)
>          sys.path.insert(0, join(prefix, 'share'))  # for libmypaint
> 
> 
> 
> So the issue should go around multilib support.

Patch works for me.
Comment 9 Guillaume Castagnino 2018-07-24 19:21:57 UTC
Here is my proposal to fix the ebuild. It seems that the multilib job was only partially done: install path was changed, but not the libdir computed in the main binary.
Comment 10 Larry the Git Cow gentoo-dev 2018-07-31 22:05:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcd4cee81065125672f1903237e086c3f0db741f

commit bcd4cee81065125672f1903237e086c3f0db741f
Author:     Guillaume Castagnino <casta@xwing.info>
AuthorDate: 2018-07-31 20:25:34 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-07-31 21:57:29 +0000

    media-gfx/mypaint: drop broken multilib handling
    
    The current multilib handling is only partial as it moves libs to
    $(get_libdir) but does not fix the python entry point to load librbries
    from the correct directory. The bug is only triggered on SYMLINK_LIB
    systems.
    As this package will never be installed for multiple libdirs, drop this
    and stick to upstream.
    
    Closes: https://bugs.gentoo.org/648960
    Closes: https://github.com/gentoo/gentoo/pull/9337
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 media-gfx/mypaint/mypaint-1.2.1-r1.ebuild | 77 +++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)