-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Failed to find a python version from target process #397
Comments
Which py-spy version is it? (displayed when you run plain Also - can you please run with |
Thanks for the quick reply guys. The version I have is and oddly, after reinstalling the package, the commands seems to work. I am not sure what changed though. I'll open the issue again if I run into any problems. |
FYI I just ran into this error and fortunately found this solution. I'm running Win10 and a venv. Maybe this would be good to stick in the faq's? |
This problem is not yet fixed in py-spy 0.3.14 on windows (venv) when profiling native code.
The problem is not only related to (venv), since calling your python script/module through an activation point does lead to the same problem when not using "-s" which in Windows is unusuable when trying to analyze native modules |
When I ran with DEBUG flag, I got this at the very end -:
I am running this within a Docker container and Python 3.8.17 and Apple M1 Chip. |
I'v got the issue: |
With py-spy 0.3.14, in my case, it looks it struggles to get the extract the version from the path:
|
Have the same problem, py-spy version is 0.3.14, MacOS version is Sonnoma 14.5 |
Same problem, py-spy 0.3.14, MacOS Ventura 13.2.1 |
For macOS folks, just spent 3 hours debugging this 🫡 Here's how I fixed it: TL; DR: I uninstalled the Python I installed through # Uninstall other Python binaries through brew or rm
brew uninstall [email protected]
# Setup pyenv
brew update
brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
# Restart your shell
exec "$SHELL"
# Install Python
pyenv install 3.11.8
# Use it globally
pyenv global 3.11.8 Longer explanation (from this section of py-spy README): macOS SIP is preventing all users from reading memory from any binary located in protected directories (such as
Hope this helped ! |
For pretty much any command i run (top, record and dump) i get the following:
I've installed py-spy through poetry (pip). I am trying running it through both the
poetry run py-spy ..
as well as activate the env and runpy-spy ...
OS: Windows 10
Python: 3.9.4
The text was updated successfully, but these errors were encountered: