Ask Your Question

conflict of Python to use GBD with Ros for Windows

asked 2020-04-09 13:43:58 -0500

gaspard_bourgeois gravatar image

I recently installed Ros for Windows here.

I couldn't manage to make gdb work with ROS, it seems that the python environnement of ROS affect the execution of GDB.

I installed GDB with msys64.

When I start a console everything is working fine:

GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) q

C:\windows\system32>where gdb

C:\windows\system32>where python

When I source ROS, the Python variable are updated end I couldn't use GDB anymore, see here:

Python path configuration:
  PYTHONHOME = 'C:\opt\python27amd64\'
  PYTHONPATH = 'C:/opt/ros/melodic/x64\lib/site-packages'
  program name = 'C:\msys64\mingw64\bin\python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:\\msys64\\mingw64\\bin\\python'
  sys.base_prefix = 'C:\\opt\\python27amd64\\'
  sys.base_exec_prefix = 'C:\\opt\\python27amd64\\'
  sys.executable = 'C:\\msys64\\mingw64\\bin\\python'
  sys.prefix = 'C:\\opt\\python27amd64\\'
  sys.exec_prefix = 'C:\\opt\\python27amd64\\'
  sys.path = [
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 0x000017c4 (most recent call first):
<no Python frame>

I went to use GDB to debug some of my script in ROS ? Are they anyway to solve this issue ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-09 14:19:09 -0500

OoeyGUI gravatar image

Please use the Visual Studio Code ROS extension for debugging ROS on Windows.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-04-09 13:43:58 -0500

Seen: 134 times

Last updated: Apr 09 '20