Skip to content

kernprof -m and -p cannot find modules inside a namespace package #387

Description

@gwerbin-tive
src/
  my_namespace/
    a/
      __init__.py
      core.py
PYTHONPATH="${PWD}/src" uv tool run --from 'line-profiler==5.0.0' kernprof -l -m my_namespace.a.core

I expected that this would work. But I get this error:

`Could not find module `my_namespace.a.core`

Adding src/my_namespace/__init__.py fixes the error and profiling appears to work normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions