pyroscope-rs icon indicating copy to clipboard operation
pyroscope-rs copied to clipboard

Unsupported version of Python: 3.12.0

Open Battlesheepu opened this issue 1 year ago • 4 comments

Describe the bug you encountered:

I've been trying to use the pyroscope-io Python library to send data to my Pyroscope instance. The problem is, based on the logs, the Python 3.12 version is not supported.

The debug logs say it explicitly:

 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Getting version from python binary BSS
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to get version from BSS section: failed to find version string
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Trying to get version from path: /usr/bin/python3.12
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > python version 3.12.0 detected
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to get interp_head from symbols, scanning BSS section from main binary
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to connect to process, retrying. Error: Unsupported version of Python: 3.12.0
 2024-06-22T17:36:41.614Z INFO  py_spy::python_spy > Got virtual memory maps from pid 20864:

What did you expect to happen instead?

I expected the library to work as it did with the older Python versions.

How did you install pyroscope-rs?

Pyroscope installed via pip install pyroscope-io

$ pip freeze | grep -i pyroscope                                                                                                                                 INT|INT ✘  pyroscope   19:36:42  
pyroscope-io==0.8.7

I've encountered the problems on both Ubuntu 22.04 and 24.04, both with a virtual env created from the system-wide Python and in a Python installation built from source.

Additional words

Huge thanks for the help in advance!

Battlesheepu avatar Jun 22 '24 17:06 Battlesheepu

In terms of py-spy itself, there's already a few issues for it:

  • https://github.com/benfred/py-spy/issues/670
  • https://github.com/benfred/py-spy/issues/661
  • https://github.com/benfred/py-spy/issues/633

So I understand the problem is on the py-spy side, but could we actually track it here to make sure the py-spy version gets bumped as soon as it supports Python 3.12?

Battlesheepu avatar Jun 22 '24 19:06 Battlesheepu

another option could be to not use pyspy for our pip package. pyspy was designed to be used out of process and pyroscope pip package is inprocess so we don't have to solve some of the issues. This could also help solving performance issues.

korniltsev avatar Jun 24 '24 03:06 korniltsev

Or maybe we can use austin as an alternative to py-spy? https://github.com/P403n1x87/austin

pickfire avatar Jul 22 '24 02:07 pickfire

3.12 support for py-spy merged in: https://github.com/benfred/py-spy/pull/642

geertn avatar Oct 22 '24 07:10 geertn

Support for 3.12 and 3.13 has merged in benfred/py-spy#642 and v0.4.0 has been released

pschwartz avatar Nov 01 '24 23:11 pschwartz