This is a known issue when stepping into an import. Your code is in
the import machinery, which doesn't have source code. The stack viewer
shows what module it is in.

For now, if you want to debug lines in a module as it is importing,
the easiest way is to set a breakpoint in the module. The module
viewer (m) imports a module, so you'll need to set a breakpoint then
restart pudb to actually hit it.

Aaron Meurer

On Sun, Aug 11, 2019 at 10:11 PM Andreas Kloeckner
<[email protected]> wrote:
>
> Haroldo,
>
> "Haroldo Gambini Santos" <[email protected]> writes:
> > I'm trying to debug a python module, but when I try to step into a line:
> >
> > from mip.gurobi import SolverGurobi
> >
> > I got the message:
> >
> >  <no source code available>
> >
> >  If this is generated code and you would like the source code to show up 
> > here,
> >  add it to linecache.cache, like
> >
> >  import linecache
> >  linecache.cache[filename] = (size, mtime, lines, fullname)
> >
> > You can also set the attribute _MODULE_SOURCE_CODE in the module in which 
> > this function
> > was compiled to a string containing the code.
> >
> > Linecache.cache is a config file ?
> >
> > This is strange, other debuggers seem to work (kdevelop),
> > Could anyone help me ?
>
> Linecache is part of the Python standard library:
>
> https://docs.python.org/3/library/linecache.html
>
> It's hard to help you with your situation without more details. What
> module are you trying to examine? How was it installed? Do you get the
> right file name if you execute 'print(module.submodule.__file__)'? If
> not, any idea why not? What's your Python version?
>
> Andreas
> _______________________________________________
> Pudb mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
Pudb mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to