Most of the time I run my Python softwares like this: python -m package.module.module. This is generally better than doing python path/path/script.py, because imports are resolved properly.
I can use this and still profile with mprof: mprof run python -m package.module.module. This works well, but if I want timestamps for functions to be recorded, it doesn't work, i.e: if I remove from memory_profile import profile from my code, I get an import error when I use the @profile decorator.
I've read the doc and searched the issues but I couldn't find a solution. Could you help me please?
Hello,
Most of the time I run my Python softwares like this:
python -m package.module.module
. This is generally better than doingpython path/path/script.py
, because imports are resolved properly.I can use this and still profile with mprof:
mprof run python -m package.module.module
. This works well, but if I want timestamps for functions to be recorded, it doesn't work, i.e: if I removefrom memory_profile import profile
from my code, I get an import error when I use the@profile
decorator.I've read the doc and searched the issues but I couldn't find a solution. Could you help me please?