ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> visualpython-discuss
visualpython-discuss
Re: [Visualpython-discuss] Problems debugging Modules..
by Eric Promislow other posts by this author
Aug 18 2005 12:06PM messages near this date
view in the new Beta List Site
[Visualpython-discuss] Problems debugging Modules.. | [Visualpython-discuss] Debugging a multi-threaded app with breakpoints
Michael Collins wrote:
>  Hi,
>  
>  I've been asked to download and evaluate the Visual Python Trial for
>  the company I work for.
>  
>  Unfortunately it doesn't seem to be going too well so far.
>  
>  First off, I'm using Visual Studio .Net 2003, it has all microsoft
>  service packs installed etc.
>  My workstation is a Windows XP professional machine, again with all
>  service packs etc. applied.
>  I already had Python 2.4.1 from python.org installed on my machine,
>  along with a bunch of python modules including pywin32.
>  I downloaded the Latest Visual Python, 1.83 from the activestate site.
>  
>  I have set up a Solution with 2 projects which corresponds to the
>  directory structure for the python I am trying to debug.
>  
>  This is the directory stucture roughly
>  
>  Services>    __init__.py
>     ServicesCommon>        __init__.py
>        file1.py
>        file2.py
>        ...
>     Teams>       __init__.py
>        file3.py
>        file4.py
>        ...
>  
>  
>  My Solution is Services.sln with 2 projects, ServicesCommon and Teams.
>  
>  In the a Teams Service in the teams directory I have a this line:
>  from Services.ServicesCommon.XmlHelper import XmlHelper
>  
>  Trying to debug one of this program in the Teams modules which refers
>  to files in the ServicesCommon doesn't work.
>  
>  I get output like this:
>  
>  Starting Python debug run ...
>  Traceback (most recent call last):
>    File "c:\program files\activestate visual python\callvpython.py ",
>  line 105, in ?
>      main(sys.argv[1:])
>    File "c:\program files\activestate visual python\callvpython.py ",
>  line 100, in main
>      else: requestor.start(script_args)
>    File "c:\program files\activestate visual python\kdbxml.py", line
>  709, in start
>      return Requester.start(self, debug_args)
>    File "c:\program files\activestate visual python\kdbxml.py", line
>  311, in start
>      self._do_start(debug_args)
>    File "c:\program files\activestate visual python\kdbxml.py", line
>  343, in _do_start
>      self.kdb.run(code_ob, locals, locals)
>    File "C:\Python24\lib\bdb.py", line 366, in run
>      exec cmd in globals, locals
>    File "c:\michael\code\Services\Teams\Teams_Service.py", line 26, in ?
>      from MMP_Services.Teams.Teams_Core import Teams
>  ImportError: No module named MMP_Services.Teams.Teams_Core
>   
>  If it was a standard vc++ project I would be able to add a dependancy
>  from Teams to ServicesCommon.
>  
>  I have tried adding the path to the Services directory, and the
>  directory below it to the PYTHONPATH environment variable. (Both in
>  Tools -> Options -> Projects -> VisualPython Python Path in visual
>  studio, and by setting a windows environment PYTHON_PATH variable)
>  
>  Using the pyDev Eclipse plugin I create a workspace in Services and am
>  able to add the ServicesCommon and Teams directory as additional paths
>  in the pyDev PythonPath.
>  
>  Running it in pdb from the command line I just start a python session
>  in the c:\michael\code directory, import pdb, import the module and
>  start it running.
>  
>  What really puzzles me is that the context menu when i right lcick on
>  the import statement  in the ide which the debugger is crashing on the
>  ide can pull up the file which it references.
>  
>  Any pointers or tips?

I've added a bug -- http://bugs.activestate.com/show_bug.cgi?id=40489 --
requiring that we put in a field in the project properties to specify
the directory to run a script from.

I'm not sure why the PYTHONPATH isn't being used.

Thanks for reporting this,
Eric

>  
>  Cheers
>  
>  Michael
>  
>  _______________________________________________
>  Visualpython-discuss mailing list
>  Visualpython-discuss@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Visualpython-discuss mailing list
Visualpython-discuss@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Michael Collins
Eric Promislow

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved