Author Topic: gdb ModuleNotFoundError: No module named 'encodings'  (Read 98 times)


  • Senior Community Member
  • Posts: 239
  • Hero Points: 22
gdb ModuleNotFoundError: No module named 'encodings'
« on: July 30, 2022, 03:14:09 pm »
Cannot use provided GDb on SE v26.0.3.1.x64 on Win10Pro21H2.x64.
Embedded gdb.exe gives this error (see pic1):
Code: [Select]
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: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Python 3.10.5 is installed for all users (installed as Admin and added to path, see pic2) and Python and python scripts work.
As well as MinGW GDB32 (old v7.6.1 see pic3). If SE is configured to use this MinGW GDB, debugging starts and works, but if configured to use the embedded GDB it fails with “Error starting debugger:  GDB has terminated prematurely”. When I tried to start manually the embedded gdb I noticed the mentioned error (gdb32.exe has the same error).

Browsing net found some suggestions to set PYTHONHOME and PYTHONPATH (C:\Program Files\Python310 respectively C:\Program Files\Python310;C:\Program Files\Python310\Lib\encodings;C:\Program Files\Python310\Lib\site-packages;C:\Program Files\Python310\Lib;C:\Program Files\Python310\libs;C:\Program Files\Python310\Scripts) but that led to another “AttributeError: module 'sys' has no attribute 'winver'” python error.
Can anybody confirm and is there a solution? For the moment I have to use the externam MinGW debugger which works fine though.

Code: [Select]
Serial number: WB951378
Licensed number of users: Single user
License file: C:\ProgramData\slickedit\26\slickedit.lic

Build Date: June 28, 2022
Emulation: CUA

OS: Windows 10 x64
OS Version: 10.00.0 
Memory: 11% Load, 3600MB/32464MB Physical, 5602MB/32464MB Page File, 4648MB/134217727MB Virtual
Shell Information: C:\Windows\system32\cmd.exe /q
Screen Size: 1920 x 1200 (0 0 1920 1200), 1920 x 1200 (-1920 0 1920 1200)

Project Type: Gnuc
Language: .c (C/C++)
Encoding: ACP (1252)

Installation Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\core\26.0.3\ (non-removable drive,NTFS,181797MB free)
Configuration Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\config\26.0.3\ (non-removable drive,NTFS,181797MB free)
Spill File: C:\Users\work\AppData\Local\Temp\$slk.5004 (non-removable drive,NTFS,187683MB free)


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3648
  • Hero Points: 483
Re: gdb ModuleNotFoundError: No module named 'encodings'
« Reply #1 on: August 01, 2022, 03:18:35 pm »
Reproduced.  I would recommend continuing to use the MingW GDB that you already had installed.  I'll see if we can improve this configuration on Windows for the next release.