Open secsilm opened 1 year ago
How did you install the python you are trying to profile ?
Not the reporter, and we're on Windows here:
Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; print(sys.version)
3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)]
This python is downloaded from www.python.org, installed via PyCharm.
py-spy is installed through pip.
> py-spy.exe --version
py-spy 0.3.14
How did you install the python you are trying to profile ?
Sorry for late reply. I install the python and pip by:
sudo apt install python3.8
sudo apt install python3-pip
python3.8 -m pip install pip
Same error here.
command py-spy record -o profile.svg -- python ccdata.py
My environment:
compiled with:
x86_64-pc-linux-gnu-gcc -c -Wsign-compare -DNDEBUG -O3 -pipe -march=tigerlake -fwrapv -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -I/usr/include/ncursesw -fPIC -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
Same error, my program (https://github.com/AUTOMATIC1111/stable-diffusion-webui) seems to run the first few lines and then it gives up later, it ends up spawning subprocesses (pip
) to install dependencies
# py-spy top -- %PYTHON% launch.py --skip-install
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Commit hash: 8e439067bc6d197b4b672438a0ca6114d3cc7a6c
Installing sd-dynamic-prompts requirements.txt
Error: Failed to find a python interpreter in the .data section
EDIT: Fixed it, issue was I didn't install my python with debugging symbols (.pdb
s). When you launch the Python installer it gives you the option to download them under "Custom Install". Reading the docs, if py-spy doesn't detect the .pdb
it tries to scan the binary for whatever it needs, fruitlessly
Same error, my program (https://github.com/AUTOMATIC1111/stable-diffusion-webui) seems to run the first few lines and then it gives up later, it ends up spawning subprocesses (
pip
) to install dependencies# py-spy top -- %PYTHON% launch.py --skip-install Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Commit hash: 8e439067bc6d197b4b672438a0ca6114d3cc7a6c Installing sd-dynamic-prompts requirements.txt Error: Failed to find a python interpreter in the .data section
- Windows Server 2022
- Python 3.10.9
- py-spy 0.3.14 (pip)
EDIT: Fixed it, issue was I didn't install my python with debugging symbols (
.pdb
s). When you launch the Python installer it gives you the option to download them under "Custom Install". Reading the docs, if py-spy doesn't detect the.pdb
it tries to scan the binary for whatever it needs, fruitlessly
thank you for this. i had the same .data error. i just reinstalled python with the symbols and it works now. Thank you!
I too was having this same issue on Windows with a custom built python 3.10 binary running embedded in a very large application. Once I dropped the symbols alongside the DLL it worked like a charm!
As a suggestion, it might be good to log about missing symbols with this error
I got the
Error: Failed to find a python interpreter in the .data section
error when I runsudo env "PATH=$PATH" RUST_LOG=debug py-spy record -o profile.svg --pid 40067
.Here is the full log.
Here is my environment: