Open arthur-e opened 4 years ago
ran into the same problem today. For my case is that I can find two
kernprof: /home/user_name/.local/bin/kernprof /home/user_name/some/env/dirs/bin/kernprof
by running whereis kernprof. I suspect when one call kernprof the system prioritizes to call the first one, which is not the one in the virtual environment.
calling
/home/user_name/some/env/dirs/bin/kernprof some_code.py plus_args
(Or just simply delete the first one :-/) will resolve the problem.
I'm trying to use
kernprof
with a script that is used in a virtual environment (created withvirtualenv
). This virtual environment uses some system-wide packages (i.e., with--system-site-packages
) but some are also local to the virtual environment. It seems thatkernprof
can't locate these modules? In the example below, it can't find thecached_property
module, but a quickpip freeze
confirms that, indeed, this module is available.I confirmed that switching a module from a local to a system-wide install fixed this issue; i.e., after removing
cached_property
from the virtual environment and installing system-wide withsudo -H pip install cached_property
,kernprof
moved on to complain about a different module.Here are my stats:
pip
version 19.2.1virtualenv
version 15.1.0kernprof
version 1.0b2Thanks!