Using Wing with Cygwin

Index of All Documentation » How-Tos » How-Tos for Containers »


Wing Pro Screenshot

Wing is a Python IDE that can be used to develop, test, and debug Python code written for cygwin, a Linux/Unix like environment for Microsoft Windows.

Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional developers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for Cygwin. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.

Note: This document was last tested with cygwin 3.6.

Debugger Configuration

To write and debug code running under cygwin, download and install Wing for Windows on your machine. Wing does not run on cygwin but you can set up Wing for Windows to work with Python code that is running under cygwin.

Cygwin has a different view of the file system than the paths used by Windows applications. This causes problems when code is debugged since Wing cannot find the files referenced by their cygwin name.

The solution to this problem is to treat Python running under cygwin as if it were running on a separate system. This is described in Debugging Externally Launched Code. In this model, you will always launch your Python code from cygwin rather than from Wing's menus or toolbar.

When setting this up according to the instructions provided by the above link, use cygwin paths for WINGHOME in wingdbstub.py because this file will be used on the cygwin side.

Wing will look for the wingdebugpw authentication token file in ~/.wingpro7 on cygwin, if it exists. Otherwise the standard Windows settings directory will be used.

You will also need to configure cygwin so that the cygwin pathnames are equivalent to the Windows pathnames. An example would be to set up /src in cygwin to point to the same directory as \src on Windows, which is src at top level of the main drive, usually c:\src. Wing will ignore the difference between forward and backward slashes in path names.

If you cannot set up matching cygwin and Windows paths like this, you will instead need to use the Debugger > Advanced > Location Map preference to translate to and from your cygwin names. For example, if your cygwin files are at /c/src/test and this directory is c:\\src\test on Windows then you would add a location map entry as follows:

Remote IP 127.0.0.1 - Remote: /c/src/test, Local: c:/src/test

Note the use of forward slashes in the the Local specification even though the file is on Windows.

When in doubt, an easy way to determine the correct cygwin file path to use is to place assert 0 into a file and refer to the traceback shown in the Exceptions tool in Wing when the file is debugged via wingdbstub.

Related Documents

For more information see: