I previously uninstalled Python3.12 (on which I had ran Miniedit-WiFi tool) and left the default Python3.11; however the following console-log error keeps popping out whenever I run a Python script on the Python3.11 regardless of whether I run from a Virtual environment or from the base Python interpreter. (The default Python3.11 is also however still broken too as I cannot install anymore packages using pip despite other projects than the. (This is on
Kubuntu-Mantic
)
I have ran another TensorFlow ML script that works well in its virtual environment and realized that the issue is in the Python sudoer system; the console output I shared above always comes when I try run a Python script with sudo privilege (eg:
sudo python3 /path/to/any/python/script
); So I opened all the setup files in/etc/sudoers.d/
but could not see any trace of the Python3.12 path setup yet the Python path is clean with only the default base Python3.11 & Python3.7 This issue can after I used thesudome
app for automatingsudo
privilege for my Miniedit project in Pycharm when I had Python3.12 install, but after I uninstalled the Python3.12 and cleared it out of the Python path, I can no longer run Python scripts withsudo
privilege as the console output suggests its Python path pointing to the Python3.12 which I uninstalled already. Can anyone can help me trace where this output is coming from
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = '/usr/local/lib/python3.12'
sys._base_executable = '/usr/local/bin/python3'
sys.base_prefix = '/usr/local'
sys.base_exec_prefix = '/usr/local'
sys.platlibdir = 'lib'
sys.executable = '/usr/local/bin/python3'
sys.prefix = '/usr/local'
sys.exec_prefix = '/usr/local'
sys.path = [
'/usr/local/lib/python312.zip',
'/usr/local/lib/python3.12',
'/usr/local/lib/python3.12/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f5dbb036740 (most recent call first):
<no Python frame>
python3
related, that detail is helpful (python3 is a system tool, esp. on desktop systems)sudo python3 /path/to/any/python/script
); So I opened all the setup files in/etc/sudoers.d/
but could not see any trace of the Python3.12 path setup yet the Python path is clean with only the default base Python3.11 & Python3.7 (Kubuntu-Mantic)