benfred / py-spy

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

Add a section to documentation/FAQ about -s flag for venvs? #483

Open RheingoldRiver opened 2 years ago

RheingoldRiver commented 2 years ago

I just installed this (Windows 10), followed the setup instructions, and got the error Error: Failed to find python version from target process. After about 15 minutes of searching and reading through various issues I finally found this PR and everything is working now. But, it would be helpful I think if the README mentioned the -s flag for venvs? I'm not sure the entire scope of when this should be used so I don't feel comfortable writing a section myself and opening a PR, sorry.

(For completeness, the full command that I'm running in the venv is py-spy record -s -o profile.svg -- python my_script.py.)

I'm also not sure what other circumstances this error shows up in, but I might mention that -s needs to be used if running in a venv in this error message if this is a primary case in which it appears, although if this is clearly documented it's probably less important.

Thanks!