I recently made some changes to my system configuration - and broke my Cygwin GDB debugging functionality.
After spending a few hours exploring the problem, I thought sharing this post might help someone else minimize their cycle time if they have a similar problem...
The first clue was in a Windows Command Prompt, I got the following error when trying to launch GDB:
"ImportError: No module named site"Also, in Eclipse, when attempting to launch the debugger for a C++ program, I encountered this error message:
"Could not determine DGB version using command gdb --version"I read several forum postings - and these were the relevant takeaways:
- http://stackoverflow.com/questions/5599872/python-windows-importerror-no-module-named-site
- https://docs.python.org/2/using/windows.html
- https://docs.python.org/3/using/windows.html
- "The
PYTHONPATH
variable is used by all versions of Python 2 and Python 3, so you should not permanently configure this variable unless it only includes code that is compatible with all of your installed Python versions." - "he Python launcher for Windows is a utility which aids in locating and executing of different Python versions"
- "System-wide installations of Python 3.3 and later will put the launcher on your
PATH
. The launcher is compatible with all available versions of Python,"
No joy.I then uninstalled and re-installed Cygwin.
No joy.Then I tried alternating where PYTHONHOME and PYTHONPATH pointed...to 2.7 vs 3.5
No joy.Finally, I removed the System Variables for PYTHONHOME and PYTHONPATH.
Success.When in the Cygwin bash shell (or Windows Command Prompt window) - the Windows System Variables for PYTHONHOME and PYTHONPATH were conflicting with the Python 2.7 version that is bundled with Cygwin - and a dependency for GDB.
So I then just added the dir for Python 3.5 directly to the PATH environment variable.
Problem solved.
No comments:
Post a Comment