Skip to content
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 interpreter in the .data section #546

Closed
secsilm opened this issue Jan 9, 2023 · 8 comments
Closed

Error: Failed to find a python interpreter in the .data section #546

secsilm opened this issue Jan 9, 2023 · 8 comments

Comments

@secsilm
Copy link

secsilm commented Jan 9, 2023

I got the Error: Failed to find a python interpreter in the .data section error when I run sudo env "PATH=$PATH" RUST_LOG=debug py-spy record -o profile.svg --pid 40067.

Here is the full log.

Here is my environment:

  • OS: Ubuntu 18.04.5 LTS (Bionic Beaver)
  • Python: Python 3.8.0
  • py-spy: 0.3.14
@benfred
Copy link
Owner

benfred commented Jan 17, 2023

How did you install the python you are trying to profile ?

@Atleago
Copy link

Atleago commented Jan 19, 2023

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

@secsilm
Copy link
Author

secsilm commented Feb 1, 2023

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

@martin-kokos
Copy link

Same error here.
command py-spy record -o profile.svg -- python ccdata.py

My environment:

  • OS: Gentoo
  • Python: Python 3.11.1 (compiled via distro package manager, GCC 12.2.1 20230121 )
  • py-spy: 0.3.14 (via poetry)

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

@space-nuko
Copy link

space-nuko commented Mar 21, 2023

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 (.pdbs). 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

@notwopr
Copy link

notwopr commented Mar 23, 2023

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 (.pdbs). 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!

@jkriegshauser
Copy link

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

@benfred
Copy link
Owner

benfred commented Nov 1, 2024

This should be fixed in the lastest release (0.4.0) - by #543 and #718. You shouldn't need symbols anymore to profile python 3.10+ on windows

@benfred benfred closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants