conflict of Python to use GBD with Ros for Windows
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:
C:\windows\system32>gdb
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) q
C:\windows\system32>where gdb
C:\msys64\mingw64\bin\gdb.exe
C:\windows\system32>where python
C:\opt\python27amd64\python.exe
When I source ROS, the Python variable are updated end I couldn't use GDB anymore, see here:
C:\windows\system32>c:\opt\ros\melodic\x64\setup.bat
C:\windows\system32>gdb
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 = [
'C:/opt/ros/melodic/x64\\lib/site-packages',
'C:\\opt\\python27amd64\\\\lib\\python38.zip',
'C:\\opt\\python27amd64\\\\lib\\python3.8',
'C:\\opt\\python27amd64\\\\lib\\python3.8',
'C:\\opt\\python27amd64\\\\lib\\python3.8\\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 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 ?