winpdb & virtualenv?

558 views
Skip to first unread message

allen.fowler

unread,
Aug 11, 2009, 10:47:29 AM8/11/09
to Winpdb
Hello,

I am trying to use winpdb in a virtualenv --no-site-packages setup,
and am getting an error while trying to launch...

source bin/activate
winpdb
[..SNIP..]
wxPython was not found.
wxPython 2.6 or higher is required to run the winpdb GUI.
wxPython is the graphical user interface toolkit used by Winpdb.
You can find more information on wxPython at http://www.wxpython.org/
The Unicode version of wxPython is recommended for Winpdb.

I do have wxpython installed, but it's on the host system and not in
the virtualenv.

How do I get this to work?

Thank you,
:)

Nir Aides

unread,
Aug 11, 2009, 11:28:12 AM8/11/09
to win...@googlegroups.com
winpdb tries to import wxpython and/or wx (i don't remember).
if you can make this import work you are OK.

alternatives are to use the command line version of this debugger (rpdb2)
or connect with internet sockets from a "remote" environment.

to do this start the debugged script with rpdb2 -d -r ... (read the command line help)
and from a remote environment run winpdb and try to attach.

You can either attach over sockets or via an SSH tunnel, etc...

Nir

allen.fowler

unread,
Aug 11, 2009, 1:52:31 PM8/11/09
to Winpdb


On Aug 11, 11:28 am, Nir Aides <n...@winpdb.org> wrote:
> winpdb tries to import wxpython and/or wx (i don't remember).
> if you can make this import work you are OK.
>
> alternatives are to use the command line version of this debugger (rpdb2)
> or connect with internet sockets from a "remote" environment.
>
> to do this start the debugged script with rpdb2 -d -r ... (read the command
> line help)
> and from a remote environment run winpdb and try to attach.
>
> You can either attach over sockets or via an SSH tunnel, etc...
>


Can you elaborate? I am totally new winpdb...

Nir Aides

unread,
Aug 13, 2009, 8:51:22 AM8/13/09
to win...@googlegroups.com
Sorry for the late reply.

The problem is that your virtual env does not have wxPython installed.
You can use the command line version of the debugger which is called rpdb2.py

However, you can still use Winpdb if you connect remotely from an environment which does have wx.
I am using Winpdb to debug a script on the other side of the planet via SSH, as we speak.

Winpdb uses a client/server model.
It has two debugger components: the debugger client and the debugger server.

The script you want to debug is in fact the server side (it is running the debugger server)
The debugger UI is actually the debugger client.

When you normally run Winpdb, what happens is that the Winpdb UI (debugger client) starts, and in turn it starts the script you want to debug in a separate process as the debugger server, and then the UI (client) connects to the script (server) and the debugging session starts.

However you can always start the debugger server manually on one machine
then start the Winpdb UI with no arguments and manually ask it to "attach" to the server.

While this discussion can explode an regular brain, the bottom line is very simple:

1) In one environment start the debugged script with the following command. The script will ask for a password and then freeze while it waits for Winpdb UI (client) to attach:

python rpdb2.py -r -d <script-name> <script-args....>

2) In a second environment start Winpdb with no arguments and then click the attach item under the file menu.

Note: for the attach to work, you need to have TCP connectivity between the machines. For example a firewall might prevent incomming communication on the remote machine. In particular make sure port 51000 is open for incomming connections on the remote machine.

For more info consult the on line documentation.

boost...@googlemail.com

unread,
Aug 17, 2009, 10:02:58 AM8/17/09
to Winpdb
you can simplify the use of winpdb, by installing wxpython & winpdb at
the default location
and all of the virtualenv's use the same one. I use in that way, It
works for me.
Reply all
Reply to author
Forward
0 new messages