0

i simply remove all the reference of my python3.9 and install a python3.11 instead, then all the depencency problems showed up, for example my "terminator" not worked,

You need to install the python bindings for gobject, gtk and pango to run Terminator.

even dpkg have some error after that.

Fatal Python error: Module Not Found: No module named encoding

i 'm pretty sure that it 's because of my rude way of upgrading python version

so i 'm asking the question,

Any best practice for upgrading python version in Linux ? Or should i upgrading at all?

i 've solved most of the dependency problems now. i mean it took my entire weekend for that

Peter
  • 29
  • 2
  • Does this answer your question? [How to upgrade Python along with installed packages?](https://stackoverflow.com/questions/14328882/how-to-upgrade-python-along-with-installed-packages) – gre_gor Nov 14 '22 at 03:39
  • 3
    Bypassing your package manager is a Bad Idea. If your operating system's package manager doesn't do what you want, think about using an _additional_ package manager; for example, you can tell [Nix](https://nixos.org/) to install `python311.withPackages (p: [p.gtk p.pango ...etc...])` and it'll install Python 3.11 with all your packages and their native dependencies. (Caveat that I didn't check those names against nixpkgs; consider it pseudocode, not concrete advice). – Charles Duffy Nov 14 '22 at 03:40
  • 1
    @gre_gor, ...the answer there works to a point; specifically, the point where you need more C libraries or headers installed, after which it no longer works. (If the OP installed something like pygtk as a package, it may not have depended on gtk-devel packages, f/e). – Charles Duffy Nov 14 '22 at 03:40
  • 1
    That said, I'd argue that this is a "using your Linux distro correctly" question, not really a Python question at all; you'd have very similar problems trying to upgrade _any_ major OS component with a neither-API-nor-ABI-compatible release that your distro vendor's tools rely on but which they haven't tested, recompiled for, or otherwise made any moves to support. And using-your-distro-correctly questions are better suited to [unix.se] than Stack Overflow. – Charles Duffy Nov 14 '22 at 03:42
  • 1
    About using Nix, btw -- one of the important things about Nix is that it operates in an additive way; you can have _both_ Python 3.9 and Python 3.11 installed in the Nix store, but when you want to use only 3.11 in a project you _get_ only 3.11, and likewise the other way as well; so you never need to upgrade what's installed for your whole system, but can instead control only what's installed for a single account, or a single project, or otherwise a very limited scope without changing or breaking anything else. – Charles Duffy Nov 14 '22 at 03:46
  • @gre_gor i' m not sure,but it seems like a little bit more complicated than just python package problem. You got lots of original package dependences which needed to be built on your pythonhome again and again – Peter Nov 14 '22 at 06:15
  • @CharlesDuffy i just get your point~ i really need more basic unix knowledge support. – Peter Nov 14 '22 at 06:23
  • 1
    You can have both Python 3.9 and 3.11 on the same system, it should be no problem at all. Meaning you did not need to uninstall Python 3.9. -- Anyway this question seems out of scope for StackOverflow, there are other StackExchange sites that might be better for this question ([unix](https://unix.stackexchange.com/), [superuser](https://superuser.com/), etc.) – sinoroc Nov 14 '22 at 08:23

0 Answers0