allegro / ralph

Ralph is the CMDB / Asset Management system for data center and back office hardware.
https://ralph.allegro.tech/
Apache License 2.0
2.21k stars 544 forks source link

Fatal Python error: Py_Initialize: Unable to get the locale encoding #3832

Open bhimraojabraska opened 1 month ago

bhimraojabraska commented 1 month ago

gnocteam@bgptool4:~$ sudo apt-get install ralph-core=20240813.1 Reading package lists... Done Building dependency tree... Done Reading state information... Done Suggested packages: redis The following NEW packages will be installed: ralph-core 0 upgraded, 1 newly installed, 0 to remove and 96 not upgraded. Need to get 0 B/41.5 MB of archives. After this operation, 210 MB of additional disk space will be used. Preconfiguring packages ... Selecting previously unselected package ralph-core. (Reading database ... 110721 files and directories currently installed.) Preparing to unpack .../ralph-core_20240813.1_amd64.deb ... The system user `ralphsrv' already exists. Exiting. Leaving 'diversion of /etc/ralph/ralph.conf to /etc/ralph/ralph.conf.distrib by ralph-core' Leaving 'diversion of /etc/ralph/conf.d/database.conf to /etc/ralph/conf.d/database.conf.distrib by ralph-core' Leaving 'diversion of /etc/ralph/conf.d/cache.conf to /etc/ralph/conf.d/cache.conf.distrib by ralph-core' Leaving 'diversion of /etc/ralph/conf.d/redis.conf to /etc/ralph/conf.d/redis.conf.distrib by ralph-core' Leaving 'diversion of /etc/ralph/conf.d/gunicorn.conf to /etc/ralph/conf.d/gunicorn.conf.distrib by ralph-core' Unpacking ralph-core (20240813.1) ... Setting up ralph-core (20240813.1) ... Collecting django static files... Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f7314e50740 (most recent call first): Aborted (core dumped) dpkg: error processing package ralph-core (--configure): installed ralph-core package post-installation script subprocess returned error exit status 134 Processing triggers for libc-bin (2.35-0ubuntu3.8) ... Errors were encountered while processing: ralph-core needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1)

Environment