Home » Support » Index of All Documentation » Wing IDE Reference Manual » Trouble-shooting Guide » Trouble-shooting Failure to Debug »

Wing may fail to start the debug process in certain cases. If this happens, it often helps to try debugging a small test such as the following:

print("test1")
print("test2")

Use the Step Into command from the Debug menu to cause Wing IDE to attempt to run only as far as the first line of your code. This rules out possible problems caused by specific code.

Then check through the following common problems. For information on obtaining additional information from the debug sub-system, refer to the Diagnostic Output section:

Requires TCP/IP -- Wing's debugger uses a TCP/IP protocol to communicate with the IDE. Make sure that TCP/IP is installed and configured on your machine. If you are running a custom-built copy of Python, verify that the socket module is available.

Selecting Python Version -- If Wing says it can't find Python or if you've got multiple versions of Python on your system, make sure you've got your Project Properties set up to contain a valid interpreter (see Source / Show Python Environment menu item to verify that the right interpreter is being found).

Setting PYTHONPATH -- Enter any necessary PYTHONPATH for your debug process in Project Properties if not already defined in the environment.

Environment Conflicts -- If you set PYTHONHOME or PYTHONPATH environment variables, these may cause the debug process to fail if they do not match the particular Python interpreter that Wing is launching. You can either change the interpreter used so it matches, or unset or alter these environment values from the outside or via Project Properties from the Project menu.

  • PYTHONHOME is a problem in all cases when it doesn't match the Python interpreter reported in the Source menu's Show Python Environment dialog.
  • PYTHONPATH is only a problem if it contains directories that are part of a Python installation. When this doesn't match the interpreter version, this leads to import errors because Python tries to import incompatible modules.

Corrupt Python Install -- All forms of the Python binary distribution (TAR, RPM, and Windows installer) are known to have problems when a newer version of Python is installed directly over an older one on disk.

In this case, most Python programs will appear to work fine outside of Wing IDE but will not work within the Wing IDE debugger. This occurs because the debug support code uses sockets and other functionality that is not necessarily exercised by your debug program outside of the Wing debugger.

If you try to run a debug session in Wing IDE and it fails, you may be having this problem. The following test script can be used to confirm that the problem exists in your Python installation:

import sys
print('sys.version =', sys.version)
print('sys.executable =', sys.executable)
print('sys.version_info =', sys.version_info)
import socket
print('socket =', socket)
print('socket._socket =', socket._socket)
import select
print('select =', select)

To solve this problem, try uninstalling Python, manually removing any remaining files, and installing again. Or install Python into a new location on disk.

Once this is done, be sure to confirm that Wing is configured to use the new Python installation from the Project Properties dialog in the Project menu and that the Show Python Environment item in the Source menu displays the correct intepreter.

PyGame Full Screen Mode -- Wing's debugger is unable to debug games written with pygame when they are running in full screen mode. Use window mode instead. This is a problem also for other Python debuggers.

« 18.2. Trouble-shooting Failure to DebugTable of Contents18.2.1. Failure to Stop on Breakpoints or Show Source Code »

Failure to Start Debug