Updating to Python 3.10 without breaking system

Hello

Some days ago I upgraded the python version running on my system to 3.10. Unfortunately it seems to have broken a couple of features such as the Zorin Appearance application, as well as the Synaptic package manager.

I would like my system to run Python 3.10 as I use the language a lot but in a way which does not compromise the integrity of the system.

For example, when updating to Python 3.10, Zorin Appearance wouldn't open. I ran zorin-appearance in my shell which resulted in the following error message:

Traceback (most recent call last):
  File "/usr/bin/zorin-appearance", line 11, in <module>
    load_entry_point('zorin-appearance==4.1', 'gui_scripts', 'zorin-appearance')()
  File "/home/lvthn/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 486, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/lvthn/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2867, in load_entry_point
    return ep.load()
  File "/home/lvthn/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/home/lvthn/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/zorin_appearance/__main__.py", line 14, in <module>
    import gi
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
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)

What can I do to run python 3.10 with full system functionality?

For moving from python to 3.10. many Users have reported that the version of Python is not upgrading in Ubuntu 20.04.

sudo apt purge idle
sudo apt autoremove
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10
1 Like

I seem to have found a workable solution. For anyone reading who might benefit from this, I reinstalled python3.8 using the following command:

sudo apt reinstall python3 python3-minimal python3.8 python3.8-minimal

If I need to use GNOME software which relies on Python 3.8 I simply switch back to that version temporarily:

sudo update-alternatives --config python3

It should return something along the likes of:

There are 3 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                 Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.10   2         auto mode
* 1            /usr/bin/python3.10   2         manual mode
  2            /usr/bin/python3.8    1         manual mode
  3            /usr/bin/python3.9    2         manual mode

And I select python3.8 in this case by entering 3.

1 Like

A lot of different apps can depend on python and sadly, many applications do not call on Python generically.
This means that changing the Python on your system away from default carries a lot of risks.
I often advise people that they don't.

That is a brilliant work-around though and I hope it helps others, too.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.