Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

How to use kernprof on module? #134

Open
yabb85 opened this issue Oct 15, 2018 · 1 comment
Open

How to use kernprof on module? #134

yabb85 opened this issue Oct 15, 2018 · 1 comment

Comments

@yabb85
Copy link

yabb85 commented Oct 15, 2018

Hi,

I try to analyze my module but when i launch kernprof, I have the following error:
ValueError: Attempted relative import in non-package
I try several method to launch kernprof:

  • kernprof -l -v mymodule.__main__
    the error is:
    IOError: [Errno 2] No such file or directory: mymodule.__main__
  • kernprof -l -v mymodule/__main__.py
    the error is:
    ValueError: Attempted relative import in non-package

Normally i use the following command to launch my script:
python -m mymodule.__main__

Thank you very much

@ttbrunner
Copy link

Here's a workaround: #8
You can change the pythonpath and then it should work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants