0

The default version of winpdb for SPE is v.1.3.4 that has problems to work with Python 2.7.

Here is what I have done to upgrade the version of winpdb to v.1.4.8

Step 1> Rename

C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup_spe\plugins\winpdb

as

C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup_spe\plugins\winpdb_v.1.3.4

Step 2> Download the winpdb v.1.4.8 and copy the folder as

C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup_spe\plugins\winpdb

Step 3> Load the winpdb v.1.4.8 directly without problems.

C:\Python27\python.exe "C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup_spe\plugins\winpdb\winpdb.py"

Step 4> Launch winpdb through SPE 0.8.4.c with the following errors

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):   File "C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup\_spe\sm\wxp\NotebookCtrl.py", line 2722, in OnMouseMotion
    insidetab = self.GetInsideTab(pt)   File "C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup\_spe\sm\wxp\NotebookCtrl.py", line 2468, in GetInsideTab
    for tabs in self._tabrect: AttributeError: 'TabCtrl' object has no attribute '_tabrect' Traceback (most recent call last):   File "C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup\_spe\dialogs\winpdbDialog.py", line 144, in onDebug
    from plugins.winpdb import __file__ as fileName   File "C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup\_spe\plugins\winpdb\rpdb2.py", line 13488, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs) ImportError: No module named winpdb

I have done the following things without solving the problem

1> Add the path

C:\Documents and Settings\daliu>set PYTHONPATH PYTHONPATH=C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup_spe\plugins\winpdb

2> Add the code

import sys
sys.path.append(r'C:\Program Files\SPE-0.8.4.c-wx2.6.1.0-no_setup\_spe\plugins\winpdb')

to rpdb2.py and winpdbDialog.py

Question 1> Why SPE can find the winpdb module in the old winpdb version?

Question 2> How to fix this problem?

Thank you

q0987
  • 34,938
  • 69
  • 242
  • 387
  • 1
    1.4.8 works perfect in win 7 64 bits with python 2.6, just changing the old and new folders. SPE is 0.8.4.i (you do not have the last SPE veersion). – joaquin Oct 08 '11 at 15:14

2 Answers2

1

I followed your procedure and I got winpdb working.

However after a closer look I realized that the working rpdb2 entity was not that on spe/plugins/winpdb but another installation in my site-packages.

Maybe your problem is related with this. In your procedure you forgot to include the __init__.py file in the winpdb module. It does not come in the winpdb zip distribution file and it is needed to convert the folder into a package with modules that can be imported. You have more info about packages and module search here and here.

So, just copy paste the __init__.py file from the old to the new folder (it is an empty file anyway).

joaquin
  • 82,968
  • 29
  • 138
  • 152
  • Hi joaquin, thank you so much for your time and I really appreciate your great helps. May you give me some reference where I can grasp more idea about when & why we need this __init__.py. -thx – q0987 Oct 08 '11 at 21:44
  • 1
    @q0987 you can have a look at [python docs]( http://docs.python.org/tutorial/modules.html) – joaquin Oct 08 '11 at 21:50
0

I only needed steps 1 and 2 from the first post, then I copied the __init__.py from the next post and that alone worked for me.

So in summary:

  • Find the windb plugin in the original spe installation, and reanme it or put it somewhere safe as we need to get the __init__.py file from it later.
  • Download winpdb v.1.4.8 and put it where the original was (in the plugins folder) copy the ____init____.py from the original into the new folder. Restart spe and try debugging, this got it working for me.
Marko
  • 20,385
  • 13
  • 48
  • 64