Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I'm stucked on python3.7. How to upgrade?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
cyberbat
n00b
n00b


Joined: 31 Jan 2011
Posts: 13

PostPosted: Tue Jun 22, 2021 2:24 pm    Post subject: I'm stucked on python3.7. How to upgrade? Reply with quote

Now I have several systems with
PYTHON_SINGLE_TARGET="python3_7"
PYTHON_TARGETS="python3_7"

What it the safest way to upgrade them to python3.9? portage-3.0.18 is currently installed.
Back to top
View user's profile Send private message
cyberbat
n00b
n00b


Joined: 31 Jan 2011
Posts: 13

PostPosted: Tue Jun 22, 2021 2:29 pm    Post subject: Reply with quote

My first idea is to set
PYTHON_SINGLE_TARGET="python3_9"
PYTHON_TARGETS="python3_7 python3_9"

and run emerge -va1 portage
but I'm getting a lot of errors like this:
Code:
Calculating dependencies  . ..... done!
[ebuild  NS    ] dev-lang/python-3.9.5_p2:3.9::gentoo [3.7.10_p1:3.7/3.7m::gentoo] USE="hardened ipv6 ncurses readline sqlite ssl xml -bluetooth -
build -examples -gdbm -test -tk -verify-sig -wininst (-libressl%)" 0 KiB
[ebuild   R    ] dev-python/certifi-10001-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 K
iB
[ebuild     U  ] dev-python/setuptools-56.0.0::gentoo [54.1.1::gentoo] USE="-test" PYTHON_TARGETS="python3_9* (-pypy3) -python3_8 (-python3_7%*)"
0 KiB
[ebuild  N     ] dev-python/toml-0.10.2::gentoo  USE="-test" PYTHON_TARGETS="python3_9 (-pypy3) (-python3_10) -python3_8" 0 KiB
[ebuild     U  ] dev-python/setuptools_scm-6.0.1-r1::gentoo [6.0.1::gentoo] USE="-test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3
_8 (-python3_7%*)" 0 KiB
[ebuild   R    ] dev-python/PySocks-1.7.1-r1::gentoo  PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild   R    ] dev-python/chardet-4.0.0::gentoo  USE="-test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild     U  ] dev-python/idna-3.1::gentoo [2.10-r1::gentoo] PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild   R    ] dev-python/urllib3-1.26.4::gentoo  USE="-brotli -test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild     U  ] dev-python/requests-2.25.1-r2::gentoo [2.25.1-r1::gentoo] USE="-socks5 -test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild   R    ] app-portage/gemato-16.2::gentoo  USE="gpg -test -tools" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB
[ebuild     U  ] sys-apps/portage-3.0.20-r6::gentoo [3.0.18::gentoo] USE="(ipc) native-extensions rsync-verify (xattr) -apidoc -build -doc -gentoo-dev (-selinux) -test" PYTHON_TARGETS="python3_9* (-pypy3) (-python3_10) -python3_8 (-python3_7%*)" 0 KiB

Total: 12 packages (5 upgrades, 1 new, 1 in new slot, 5 reinstalls), Size of downloads: 0 KiB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

dev-python/setuptools:0

  (dev-python/setuptools-56.0.0:0/0::gentoo, ebuild scheduled for merge) USE="-test" PYTHON_TARGETS="python3_9 (-pypy3) -python3_8" pulled in by
    >=dev-python/setuptools-42.0.2[python_targets_pypy3(-)?,python_targets_python3_8(-)?,python_targets_python3_9(-)?,python_targets_python3_10(-)?,-python_single_target_pypy3(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-),-python_single_target_python3_10(-)] required by (dev-python/toml-0.10.2:0/0::gentoo, ebuild scheduled for merge) USE="-test" PYTHON_TARGETS="python3_9 (-pypy3) (-python3_10) -python3_8"
                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    >=dev-python/setuptools-42.0.2[python_targets_pypy3(-)?,python_targets_python3_8(-)?,python_targets_python3_9(-)?,python_targets_python3_10(-)?,-python_single_target_pypy3(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-),-python_single_target_python3_10(-)] required by (dev-python/PySocks-1.7.1-r1:0/0::gentoo, ebuild scheduled for merge) USE="" PYTHON_TARGETS="python3_9 (-pypy3) (-python3_10) -python3_8"
                                                                                                                                                                                                                                                                 
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31424
Location: here

PostPosted: Tue Jun 22, 2021 2:31 pm    Post subject: Reply with quote

Usually for have less conflicts as possible you should use this schema (from news 2021-05-05-python3-9)
Code:
Safer upgrade procedure
=======================
A safer approach is to add Python 3.9 support to your system first,
and only then remove Python 3.8.  However, note that involves two
rebuilds of all the affected packages, so it will take noticeably
longer.

First, enable both Python 3.8 and Python 3.9, and then run the upgrade
commands:

    */* PYTHON_TARGETS: -* python3_8 python3_9
    */* PYTHON_SINGLE_TARGET: -* python3_8

Then switch PYTHON_SINGLE_TARGET and run a second batch of upgrades:

    */* PYTHON_TARGETS: -* python3_8 python3_9
    */* PYTHON_SINGLE_TARGET: -* python3_9

Finally, switch to the final version and upgrade:

    */* PYTHON_TARGETS: -* python3_9
    */* PYTHON_SINGLE_TARGET: -* python3_9

Your problem is that python3_7 target is removed from almost all python packages.
So the only way is force target to python3_9 and try to resolve conflicts.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cyberbat
n00b
n00b


Joined: 31 Jan 2011
Posts: 13

PostPosted: Tue Jun 22, 2021 2:52 pm    Post subject: Reply with quote

Am I right that I can't reemerge only portage to make it support python 3.9? Do I have only to run emerge -1vUDa @world after switching to python 3.9?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31424
Location: here

PostPosted: Tue Jun 22, 2021 3:37 pm    Post subject: Reply with quote

cyberbat wrote:
Am I right that I can't reemerge only portage to make it support python 3.9? Do I have only to run emerge -1vUDa @world after switching to python 3.9?

Yes you right, maybe you can also add -u (--update) depending on the situation.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54725
Location: 56N 3W

PostPosted: Tue Jun 22, 2021 4:05 pm    Post subject: Reply with quote

cyberbat,

You can do one or two steps that you missed by getting the git portage tree and do a checkout mid way between today and your last update.
If that won't build, go back a bit further.

The gory detail is at HOWTO Update Old Gentoo
That process works for any age of last update.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9325

PostPosted: Tue Jun 22, 2021 4:21 pm    Post subject: Reply with quote

Neddy, that's overkill for a system that is only behind in python targets, not otherwise outdated. News item should be enough to follow.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54725
Location: 56N 3W

PostPosted: Tue Jun 22, 2021 7:31 pm    Post subject: Reply with quote

asturm,

Agreed. It's more an indication of it doesn't matter haw bad things look, there is a way.
Doing the intermediate steps will be more CPU time too as more packagen will be built.

Is the system really up to date except PYTHON_TARGETS?
I suspect not but we bill be hearing more.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ff11
l33t
l33t


Joined: 10 Mar 2014
Posts: 664

PostPosted: Tue Jun 22, 2021 8:38 pm    Post subject: Reply with quote

I did my update as follows, and it worked for me:

0- Keeping the old configuration similar to yours (with python3_7)...

1- I installed the dev-lang/python:3.9, there was no conflict.

2- Changed the configuration to:
Code:
PYTHON_TARGETS="python3_9"
PYTHON_SINGLE_TARGET="python3_9"


3- I only updated portage and dependencies with (it was also without conflicts):
Code:
# emerge -1av sys-apps/portage


4- I used the new portage to update the system:
Code:
# emerge -DUuavt --with-bdeps=y @world


And everything is working normally. I always had in mind that if I needed to I would use a stage3 to fix something if it went wrong, but the whole operation was calm as calm waters.
_________________
| Proverbs 26:12 |
| There is more hope for a fool than for a wise man that are wise in his own eyes. |
* AlphaGo - The Movie - Full Documentary "I want to apologize for being so powerless" - Lee
Back to top
View user's profile Send private message
cyberbat
n00b
n00b


Joined: 31 Jan 2011
Posts: 13

PostPosted: Wed Jun 23, 2021 4:39 pm    Post subject: Reply with quote

I succeeded to update portage in my situation by removing some packages that blocked portage from upgrading.
Details:
Code:
#output with list of conflicts went to file
emerge -v1 --backtrack=99 =sys-apps/portage-3.0.20-r6 > /tmp/portage-out.txt 2>&1
#making list of that stuff that prevent portage from upgrading
cat /tmp/portage-out.txt | grep -Eo 'required by \([a-z]*-[a-z]*\/[a-z\-]*-[0-9]' | sed -e 's/required by (//' | sed -e 's/-[0-9]$//' | sort -u >> ~/temp-remove.txt

#HERE you must manually edit ~/temp-remove.txt to remove packages needed by portage itself. They were portage, toml and setuptools for me.

#remove packages from the list
/usr/lib/python-exec/python3.7/emerge -aC `cat ~/temp-remove.txt`

#install latest portage
emerge -va1 --backtrack=99 sys-apps/portage


You can reinstall all needed packages from ~/temp-remove.txt after updating system.

By the way if you face the problem "emerge: no python-exec wrapped executable found in /usr/lib/python-exec.", just use '/usr/lib/python-exec/python3.7/emerge' instead of 'emerge'. Thanks for the thread https://forums.gentoo.org/viewtopic-t-1109544-start-0.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum