LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-30-2022, 02:50 AM   #1
lvm_
Member
 
Registered: Jul 2020
Posts: 943

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
borked python upgrade


TL;DR - installed a newer version of python3. It fixed several things but broke several other things. How to make it all work?

Full version: ubuntu 18.04 - officially still supported, but canonical is doing a crappy job and python3 got so old than some programs started complaining. Installed the latest version 3.10 from https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa beside the existing 3.6 from the official repo and changed the /usr/bin/python3 link to point to /usr/bin/python3.10. Programs which were requiring something newer were satisfied, but it broke several things:

unknown command handling from bash no longer works

Code:
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 28, in <module>
    from CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
    from CommandNotFound.db.db import SqliteDatabase
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
as well as some package handling stuff from cron

Code:
Aug 30 06:01:48 server apt.systemd.daily[2813]: Traceback (most recent call last):
Aug 30 06:01:48 server apt.systemd.daily[2813]:   File "/usr/bin/unattended-upgrade", line 32, in <module>
Aug 30 06:01:48 server apt.systemd.daily[2813]:     from gi.repository.Gio import NetworkMonitor
Aug 30 06:01:48 server apt.systemd.daily[2813]:   File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
Aug 30 06:01:48 server apt.systemd.daily[2813]:     from . import _gi
Aug 30 06:01:48 server apt.systemd.daily[2813]: ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)

Aug 29 19:35:07 server dbus-daemon[1050]: [session uid=1000 pid=1048] Activating service name='org.kubuntu.DriverManager' requested by ':1.5' (uid=1000 pid=1422 comm="kded5 [kdeinit5]                                  " label="unconfined")
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]: Traceback (most recent call last):
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:   File "/usr/lib/x86_64-linux-gnu/libexec/DriverManager_DBus", line 24, in <module>
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:     import dbus
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:   File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 77, in <module>
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:     import dbus.types as types
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:   File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in <module>
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]:     from _dbus_bindings import (
Aug 29 19:35:07 server org.kubuntu.DriverManager[1050]: ModuleNotFoundError: No module named '_dbus_bindings'
Aug 29 19:35:07 server dbus-daemon[1050]: [session uid=1000 pid=1048] Activated service 'org.kubuntu.DriverManager' failed: Process org.kubuntu.DriverManager exited with status 1


Aug 29 19:35:07 server org.debian.AptXapianIndex[847]: Traceback (most recent call last):
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:   File "/usr/sbin/update-apt-xapian-index", line 66, in <module>
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:     import axi.indexer
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:   File "/usr/lib/python3/dist-packages/axi/indexer.py", line 31, in <module>
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:     import xapian
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:   File "/usr/lib/python3/dist-packages/xapian/__init__.py", line 24, in <module>
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]:     from . import _xapian
Aug 29 19:35:07 server org.debian.AptXapianIndex[847]: ImportError: cannot import name '_xapian' from partially initialized module 'xapian' (most likely due to a circular import) (/usr/lib/python3/dist-packages/xapian/__init__.py)
I am not a python guru and in a bit of a loss - how can I transfer/install/index/convert/make available/whatever the stuff which works in 3.6 to 3.10? Note that all these errors are about the stuff installed in a shared /usr/lib/python3/dist-packages directory, not a version-specific site-packages. Or should I abandon the idea, create a separate environment for finicky programs and leave 3.6 as the default?
 
Old 08-30-2022, 05:22 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
I find that when it is necessary to have more than one version loaded the use of the python virtual environment is a life saver.

With the major changes between 3.6 and 3.10 it seems likely that the system files may have conflicts, but a virtual environment install keeps the newly installed version isolated in the users home directory and does not conflict the same way 2 different versions installed in the system does.

How to do a virtual environment install (venv) is easy and instructions are found online very easily. https://docs.python.org/3/library/venv.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apt-get dist-upgrade borked nat rbees Linux - Newbie 3 04-11-2014 04:48 PM
Syslinux borked after upgrade? Now cannot boot from USB rabidredfox Linux - General 0 09-19-2010 07:19 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
[SOLVED] Slackpkg kernel upgrade has borked Tap-to-Click on Touchpad BobNutfield Slackware 9 07-18-2009 07:46 AM
Upgrade Borked My System! Need Help! leiavoia Debian 19 02-26-2006 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration