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

Bug 679714

Summary: sci-libs/tensorflow-estimator-1.13.0_rc0 - /usr/lib64/python3.6/site-packages/tensorflow/python/tools/api/generator/create_python_api.py: ImportError: cannot import name 'distribute_lib'
Product: Gentoo Linux Reporter: LE GARREC Vincent <gentoo.bugzilla>
Component: Current packagesAssignee: Jason Zaman <perfinion>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gentoo.bugzilla
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log.gz

Description LE GARREC Vincent 2019-03-07 21:04:27 UTC
I try to install tensorflow and it looks I need tensorflow-estimator

INFO: Analysed target //tensorflow_estimator/tools/pip_package:build_pip_package (20 packages loaded, 290 targets configured).
INFO: Found 1 target...
ERROR: /home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0/tensorflow_estimator/BUILD:82:1: Executing genrule //tensorflow_estimator:estimator_python_api_gen_compat_v2 failed (Exit 1): bash failed: error executing command 
  (cd /home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator && \
  exec env - \
    HOME=/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/homedir \
    PATH=/usr/lib/portage/python3.6/ebuild-helpers/xattr:/usr/lib/portage/python3.6/ebuild-helpers:/usr/lib/llvm/7/bin:/usr/lib/llvm/4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/opt/cuda/bin \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2  --apidir=bazel-out/k8-opt/genfiles/tensorflow_estimator_api/v2/ --apiname=estimator --apiversion=2  --package=tensorflow_estimator.python.estimator --output_package=tensorflow_estimator._api.v2 bazel-out/k8-opt/genfiles/tensorflow_estimator/_api/v2/v2.py bazel-out/k8-opt/genfiles/tensorflow_estimator/_api/v2/estimator/__init__.py bazel-out/k8-opt/genfiles/tensorflow_estimator/_api/v2/estimator/experimental/__init__.py bazel-out/k8-opt/genfiles/tensorflow_estimator/_api/v2/estimator/export/__init__.py bazel-out/k8-opt/genfiles/tensorflow_estimator/_api/v2/estimator/inputs/__init__.py')
Execution platform: @bazel_tools//platforms:host_platform
Traceback (most recent call last):
  File "/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py", line 30, in <module>
    create_python_api.main()
  File "/usr/lib64/python3.6/site-packages/tensorflow/python/tools/api/generator/create_python_api.py", line 503, in main
    importlib.import_module(args.package)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/__init__.py", line 25, in <module>
    import tensorflow_estimator.python.estimator.estimator_lib
  File "/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/estimator_lib.py", line 22, in <module>
    from tensorflow_estimator.python.estimator.canned.baseline import BaselineClassifier
  File "/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/canned/baseline.py", line 64, in <module>
    from tensorflow_estimator.python.estimator import estimator
  File "/home/legarrec/info/portage/sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_2_estimator_python_api_gen_compat_v2.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/estimator.py", line 33, in <module>
    from tensorflow.python.distribute import distribute_lib
ImportError: cannot import name 'distribute_lib'
Target //tensorflow_estimator/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 92.841s, Critical Path: 22.72s
INFO: 0 processes.
FAILED: Build did NOT complete successfully


Reproducible: Always




Portage 2.3.62 (python 3.6.8-final-0, default/linux/amd64/17.0/desktop/gnome/systemd, gcc-7.4.0, glibc-2.28-r5, 4.14.91-gentoo x86_64)
=================================================================
System uname: Linux-4.14.91-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:    16375316 total,  10596392 free
KiB Swap:    9767516 total,   9767516 free
Timestamp of repository gentoo: Mon, 04 Mar 2019 22:00:01 +0000
Head commit of repository gentoo: 2e1274bf2679710e7f623105ea60c7c871c7033a
sh bash 5.0_p2
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          5.0_p2::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.8::gentoo, 3.7.2::gentoo
dev-util/cmake:           3.13.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo, 2.32::gentoo
sys-devel/gcc:            7.4.0-r1::gentoo, 8.2.0-r6::gentoo, 8.3.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

crossdev
    location: /home/legarrec/info/overlay
    masters: gentoo
    priority: 0

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

dotnet
    location: /var/lib/layman/dotnet
    sync-uri: https://github.com/gentoo/dotnet.git
    masters: gentoo
    priority: 50

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

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

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O0 -ggdb2 -g2 -pipe -fno-omit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O0 -ggdb2 -g2 -pipe -fno-omit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-j9 --load-average=9"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O0 -ggdb2 -g2 -pipe -fno-omit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news noclean parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O0 -ggdb2 -g2 -pipe -fno-omit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_FR.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O0"
LINGUAS="fr en ja"
MAKEOPTS="-j9"
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="/home/legarrec/info"
USE="X a52 aac accessibility acl acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cli colord crypt cuda cups cxx dbus dhcpcd dri dts dvd dvdr eds emboss encode evo exif fam flac fortran gdbm gif glamor gnome gnome-online-accounts gpm gtk gtk3 iconv introspection ipv6 jpeg lcms ldap libnotify libsecret libtirpc mad mng mp3 mp4 mpeg multilib nautilus ncurses nls nptl ogg opencl opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="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 sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="fr en ja" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" RUBY_TARGETS="ruby26" SANE_BACKENDS="canon_dr cardscan coolscan coolscan2 coolscan3 dc210 dc240 dc25 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_usb nec net niash p5 pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax1220u umax_pp xerox_mfp mustek_usb2" 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, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 LE GARREC Vincent 2019-03-07 21:05:18 UTC
Created attachment 568146 [details]
build.log.gz
Comment 2 jim thom 2019-03-11 12:12:02 UTC
I have same problem. If I run command sci-libs/tensorflow-estimator-1.13.0_rc0/work/estimator-1.13.0-rc0-bazel-base/execroot/org_tensorflow_estimator/bazel-out/host/bin/tensorflow_estimator/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py
 
with python3 and not python2 it say __cpu_model not defined in /usr/lib64/libtensorflow_framework.so.

I make shared library that has only cpu_model. cpu model is 

struct __processor_model {
  unsigned int __cpu_vendor;
  unsigned int __cpu_type;
  unsigned int __cpu_subtype;
  unsigned int __cpu_features[1];
} __cpu_model = {0, 0, 0, {0}};

I put this in c file and make so (gcc -static). Then use LD_PRELOAD and run command. With python2 and python3, no problem.
Comment 3 Jason Zaman gentoo-dev 2019-03-30 14:17:41 UTC

*** This bug has been marked as a duplicate of bug 678920 ***