benfred / py-spy

Sampling profiler for Python programs
MIT License
12.53k stars 414 forks source link

"No python processes found" for Python 3.10 on Windows #498

Open henriquegemignani opened 2 years ago

henriquegemignani commented 2 years ago

The following command: py-spy top -s -- py -3.10 script.py Fails with Error: No python processes found in process 3872 or any of its subprocesses, while the script itself runs successfully. If I instead run py-spy top -s -- py -3.9 script.py, it works perfectly.

Environment:

janikarki commented 2 years ago

I'm also getting one of these, depending on how I try to run.

$ py-spy record -p <pid> -o <file>
Error: Failed to find a python interpreter in the .data section
$ py-spy record -s -p <pid> -o <file>
Error: No python processes found in process <pid> or any of its subprocesses
$ py-spy record -o <file> -- python main.py
Error: Failed to find python version from target process
$ py-spy record -s -o <file> -- python main.py
[ python program runs, but no py-spy output file is written upon interrupt ]
windelbouwman commented 2 years ago

I got a similar error:

 (.venv) C:\project>py-spy top -- python gui.py
Error: Failed to find python version from target process
fleimgruber commented 11 months ago

Also seeing this with Python 3.10.11

rambo commented 5 months ago

I guess https://github.com/benfred/py-spy/issues/216 is relevant as well. I'm seeing same issue as https://github.com/benfred/py-spy/issues/216#issuecomment-1722555568 on python 3.11.9 in virtualenv.

tmct commented 1 month ago

I'm afraid we still see the "No python processes" failure when using --subprocesses, using Python 3.10 from a virtual environment.