How to update plugins for SPE Python Editor
The d开发者_运维知识库efault 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
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).
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.
精彩评论