# [Pyton] dev-python/setuptools-59.4.0 fail emerge (Solved)

## Eleazar Anzola

Buenas a todos,

Recurro nuevamente a esta grandiosa comunidad, solicitando ayuda para solventar una situación que me esta sucediendo con cualquiera de los paquetes asociados a python y pypy3. Desde la últimas actualizaciones de python de la versión 3.8 a 3.9 y 3.10 algunos paquetes comienzan a presentar errores para instalar ó actualizar.

Es de acotar que pypy3 es una dependencia obligada que tiene el sistema ERP Tryton y de la cual por ahora no puedo prescindir.

Dejo aquí salida de emerge:

```
>>> Emerging (1 of 104) dev-python/setuptools-59.4.0::gentoo

 * setuptools-59.4.0.tar.gz BLAKE2B SHA512 size ;-) ...                  [ ok ]

 * python-gentoo-patches-3.10.0_p1.tar.xz BLAKE2B SHA512 size ;-) ...    [ ok ]

>>> Unpacking source...

>>> Unpacking setuptools-59.4.0.tar.gz to /var/tmp/portage/dev-python/setuptools-59.4.0/work

>>> Unpacking python-gentoo-patches-3.10.0_p1.tar.xz to /var/tmp/portage/dev-python/setuptools-59.4.0/work

>>> Source unpacked in /var/tmp/portage/dev-python/setuptools-59.4.0/work

>>> Preparing source in /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0 ...

 * Applying 0006-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch ...

patching file command/build_py.py

Hunk #2 succeeded at 387 with fuzz 2.

patching file command/install_lib.py                                     [ ok ]

 * Will copy sources from /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0

 * pypy3: copying to /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3

 * python3_8: copying to /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-python3_8

 * python3_9: copying to /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-python3_9

 * python3_10: copying to /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-python3_10

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0 ...

>>> Source configured.

>>> Compiling source in /var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0 ...

 * pypy3: running distutils-r1_run_phase distutils-r1_python_compile

cp: './build/setuptools.egg-info' and '/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/build/setuptools.egg-info' are the same file

pypy3 setup.py build -j 3

Traceback (most recent call last):

  File "setup.py", line 87, in <module>

    dist = setuptools.setup(**setup_params)

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/setuptools/__init__.py", line 153, in setup

    return distutils.core.setup(**attrs)

  File "/usr/lib/pypy3.8/distutils/core.py", line 108, in setup

    _setup_distribution = dist = klass(attrs)

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/setuptools/dist.py", line 457, in __init__

    for k, v in attrs.items()

  File "/usr/lib/pypy3.8/distutils/dist.py", line 292, in __init__

    self.finalize_options()

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/setuptools/dist.py", line 830, in finalize_options

    for ep in sorted(loaded, key=by_order):

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/setuptools/dist.py", line 829, in <lambda>

    loaded = map(lambda e: e.load(), filtered)

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/pkg_resources/__init__.py", line 2463, in load

    self.require(*args, **kwargs)

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/pkg_resources/__init__.py", line 2486, in require

    items = working_set.resolve(reqs, env, installer, extras=self.extras)

  File "/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3/pkg_resources/__init__.py", line 777, in resolve

    raise DistributionNotFound(req, requirers)

pkg_resources.DistributionNotFound: The 'packaging>=20.0' distribution was not found and is required by the application

 * ERROR: dev-python/setuptools-59.4.0::gentoo failed (compile phase):

 *   (no error message)

 * 

 * Call stack:

 *     ebuild.sh, line  127:  Called src_compile

 *   environment, line 2952:  Called distutils-r1_src_compile

 *   environment, line 1250:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'

 *   environment, line  516:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2623:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2153:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2151:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line  856:  Called distutils-r1_run_phase 'distutils-r1_python_compile'

 *   environment, line 1241:  Called distutils-r1_python_compile

 *   environment, line 1100:  Called esetup.py 'build' '-j' '3'

 *   environment, line 1688:  Called die

 * The specific snippet of code:

 *       "${@}" || die -n;

 * 

 * If you need support, post the output of `emerge --info '=dev-python/setuptools-59.4.0::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-59.4.0::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-59.4.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-59.4.0/temp/environment'.

 * Working directory: '/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3'

 * S: '/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0'

>>> Failed to emerge dev-python/setuptools-59.4.0, Log file:

>>>  '/var/tmp/portage/dev-python/setuptools-59.4.0/temp/build.log'

 * Messages for package dev-python/setuptools-59.4.0:

 * ERROR: dev-python/setuptools-59.4.0::gentoo failed (compile phase):

 *   (no error message)

 * 

 * Call stack:

 *     ebuild.sh, line  127:  Called src_compile

 *   environment, line 2952:  Called distutils-r1_src_compile

 *   environment, line 1250:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'

 *   environment, line  516:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2623:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2153:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line 2151:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'

 *   environment, line  856:  Called distutils-r1_run_phase 'distutils-r1_python_compile'

 *   environment, line 1241:  Called distutils-r1_python_compile

 *   environment, line 1100:  Called esetup.py 'build' '-j' '3'

 *   environment, line 1688:  Called die

 * The specific snippet of code:

 *       "${@}" || die -n;

 * 

 * If you need support, post the output of `emerge --info '=dev-python/setuptools-59.4.0::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-59.4.0::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-59.4.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-59.4.0/temp/environment'.

 * Working directory: '/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0-pypy3'

 * S: '/var/tmp/portage/dev-python/setuptools-59.4.0/work/setuptools-59.4.0'
```

Salida de emerge --info '=dev-python/setuptools-59.4.0'

```
Portage 3.0.28 (python 3.9.9-final-0, default/linux/amd64/17.1/desktop, gcc-11.2.1, glibc-2.34-r3, 5.15.5-gentoo-x86_64 x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-5.15.5-gentoo-x86_64-x86_64-Pentium-R-_Dual-Core_CPU_E5500_@_2.80GHz-with-glibc2.34

KiB Mem:     8107648 total,   3130908 free

KiB Swap:    2097148 total,   1575932 free

Timestamp of repository gentoo: Tue, 30 Nov 2021 00:30:01 +0000

Head commit of repository gentoo: 6714a87a8432c81dc215fdcf0387bbe47339effa

Timestamp of repository activehome: Tue, 09 Nov 2021 10:53:00 +0000

Head commit of repository activehome: fa7f42a52f4b77e16f57ad1850eda4b4fb4c8f85

Timestamp of repository tryton: Sat, 20 Nov 2021 13:06:27 +0000

Head commit of repository tryton: be983efa14c2a6e8abfcb259d27f9954cec40288

sh bash 5.1_p12

ld GNU ld (Gentoo 2.37_p1 p1) 2.37

app-shells/bash:          5.1_p12::gentoo

dev-java/java-config:     2.3.1::gentoo

dev-lang/perl:            5.34.0-r5::gentoo

dev-lang/python:          2.7.18_p13::gentoo, 3.8.12_p1::gentoo, 3.9.9::gentoo, 3.10.0_p1::gentoo

dev-lang/rust:            1.56.1::gentoo

dev-util/cmake:           3.22.0::gentoo

sys-apps/baselayout:      2.8::gentoo

sys-apps/openrc:          0.44.8::gentoo

sys-apps/sandbox:         2.29::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo

sys-devel/automake:       1.16.5::gentoo

sys-devel/binutils:       2.37_p1-r1::gentoo

sys-devel/gcc:            11.2.1_p20211127::gentoo

sys-devel/gcc-config:     2.5-r1::gentoo

sys-devel/libtool:        2.4.6-r6::gentoo

sys-devel/make:           4.3::gentoo

sys-kernel/linux-headers: 5.15::gentoo (virtual/os-headers)

sys-libs/glibc:           2.34-r3::gentoo

Repositories:

gentoo

    location: /var/db/repos/gentoo

    sync-type: rsync

    sync-uri: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-verify-max-age: 24

    sync-rsync-verify-metamanifest: no

    sync-rsync-extra-opts: 

    sync-rsync-verify-jobs: 1

activehome

    location: /var/db/repos/activehome

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/activehome.git

    masters: gentoo

tryton

    location: /var/db/repos/tryton

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/tryton.git

    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="* PUEL"

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/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"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/var/cache/distfiles"

ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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 -O2 -pipe"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"

FFLAGS="-march=native -O2 -pipe"

GENTOO_MIRRORS="http://distfiles.gentoo.org"

LANG="es_ES.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="es"

MAKEOPTS="-j3"

PKGDIR="/var/cache/binpkgs"

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 bluetooth branding bzip2 cairo cdda cdr cli contrib crypt cups dbus dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 java jpeg lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png ppds qt5 readline sdl seccomp sensord spell split-usr ssl startup-notification svg tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ADA_TARGET="gnat_2020" 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="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" L10N="es es-ES en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python3_8" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

```

Agradecido de antemano por su valioso tiempo y gran ayuda

----------

## cameta

Lo de siempre

PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python3_8"

Ese 3.8 da problemas.

Te aconsejo que saques todo lo que hayas puesto en el make.conf y en el package.use sobre python

Deja que lo maneje el profile.

----------

## Eleazar Anzola

 *cameta wrote:*   

> Lo de siempre
> 
> PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python3_8"
> 
> Ese 3.8 da problemas.
> ...

 

Nada mi estimado, ya he quitado todo lo que estaba de PYTHON y aun persiste el problema.

Aqui dejo mi /etc/portage/make.conf

```
USE="-policykit -systemd -static-libs -llvm sensord contrib -lvm \

     -device-mapper java"

ABI_X86="64 32"

COMMON_FLAGS="-march=native -O2 -pipe"

CPU_FLAGS_X86="mmx sse sse2 sse3 ssse3"

CFLAGS="${COMMON_FLAGS}"

CXXFLAGS="${COMMON_FLAGS}"

FCFLAGS="${COMMON_FLAGS}"

FFLAGS="${COMMON_FLAGS}"

PORTDIR="/var/db/repos/gentoo"

DISTDIR="/var/cache/distfiles"

PKGDIR="/var/cache/binpkgs"

PORTAGE_FEATURES="keepwork"

LC_MESSAGES="C"

LINGUAS="es"

LANG="es_ES.utf8"

L10N="es es-ES en-US"

ACCEPT_KEYWORDS="~amd64"

ACCEPT_LICENSE="* PUEL"

MAKEOPTS="-j3"

INPUT_DEVICES="keyboard mouse synaptics"

LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"

OFFICE_IMPLEMENTATION="libreoffice"

VIDEO_CARDS="intel i965 vesa"

NINJAOPTS="-j3"

CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3"

FEATURES="userfetch parallel-fetch parallel-install clean-logs userpriv preserve-libs"
```

Aqui el /etc/portage/package.use

```
#*/* PYTHON_TARGETS: -* pypy3 python3_8 python3_9 python3_10

#*/* PYTHON_SINGLE_TARGET: -* python3_8

>=media-gfx/sweethome3d-bin-6.2 -system-java

>=dev-libs/libnl-3.5.0 utils

>=dev-python/tryton-filestore-s3-0.1.2  python_targets_python3_8

>=dev-python/boto3-1.20.17 python_targets_python3_8

>=dev-python/botocore-1.23.17 python_targets_python3_8 python_targets_python3_10

>=dev-python/setuptools-59.4.0 python_targets_python3_8 python_targets_python3_10 python_targets_pypy3

>=dev-python/packaging-21.3 python_targets_pypy3 python_targets_python3_10 python_targets_python3_8

>=dev-python/pyparsing-2.4.7-r1 python_targets_python3_10 python_targets_pypy3 python_targets_python3_8

```

 Las lineas de TARGETS estan comentadas, pero algunos paquetes piden python_targets_python3_8

----------

## cameta

El problema con estas cosas es cuando se empiezan a mezclar versiones.

Mira empieza con esto

emerge --update --newuse --deep --with-bdeps=y -qv @world

cada vez que un paquete te de problemas

emerge --resume --skipfirst

Esto para ir eliminando las incoherencias

a ver cuantos paquetes te quedan por actualizar

----------

## Eleazar Anzola

Hoy por fin he logrado solventar la situación, quite Tryton completamente del sistema, luego al hacer un 

```
sudo emerge --delclean
```

 me salto un error con dependecias masked de youtube-dl dev-python/tablib y ese mismo paquete saltaba al actualizar tryton, 

Una vez ya sin youtube-dl ni sus dependencias al hacer un 

```
sudo emerge --depclean
```

 quedo totalmente limpio mi sistema con 187 paquetes menos   :Embarassed:  , volví a actualizar todo pero esta vez con Python 3.9 así quedo sin errore, instale nuevamente youtube-dl y tryton con todos sus módulos y ya no salio ningún error inclusive setuptools dejo de quejarse y se compilo por completo.

Doy por resuelto este post

Gracias estimado cameta por tus comentario que al final de todo me llevaron justo donde estaba el paquete que frenaba al actualizar.

----------

## cameta

Me alegra que hayas podido resolverlo.

----------

