0

I installed python 3.10 with the following guide: https://computingforgeeks.com/install-latest-python-on-centos-linux/

I removed python 3.6 using the following guide: http://codestudyblog.com/cnb11/1124171947.html

Now, when I run python3 -V I get Python 3.10.0. However, when I do sudo yum update I get:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f47c266fb80 (most recent call first):
Aborted

I have tired setting PYTHONHOME and PYTHONPATH.

Jesper.Lindberg
  • 313
  • 1
  • 5
  • 14
  • Why not just install https://centos.pkgs.org/8/okey-x86_64/python3-rpm-4.14.2-11.el8.x86_64.rpm.html ?? In my experience, I've found it's always better to use rpms built by CentOS instead of building yourself. rpms from CentOS are way less prone to installation problems. try `yum install phython3` It should install all of it's dependencies also. – GoinOff Nov 12 '21 at 21:26
  • @GoinOff since I've broken YUM that is no longer an option. – Jesper.Lindberg Nov 13 '21 at 05:20
  • Never touch the default python in CentOS (And many other OS). All admin tools, dnf / yum etc. are depending on the installed CentOS python version. ("codestudyblog" is some notes, and is wrong.) ........ If you can trace the removed packages http://mirror.centos.org/centos/8/ , please reinstall with `rpm -Uvh [package].rpm` ......... Extra python3 is `python39` : AppStream.repo . – Knud Larsen Nov 14 '21 at 19:08
  • Fix yum by manually transferring the rpm to you server and reinstall yum. https://stackoverflow.com/questions/6119545/how-to-reinstall-rpm-package – GoinOff Nov 16 '21 at 00:21

0 Answers0