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

'OpenGL_accelerate.numpy_formathandler.NumpyHandler' has no attribute '__reduce_cython__' #177

Closed
zuowanbushiwo opened this issue May 17, 2021 · 3 comments

Comments

@zuowanbushiwo
Copy link

Hi all
For me, this is a very useful project, I following steps (https://github.com/tlecomte/friture/blob/master/INSTALL.md#running-friture-from-source-on-windows) to prepare a development environment for Friture on Windows. But when I used PyCharm run main.py has the following error, how to solve it?

Traceback (most recent call last):
File "C:\Users\admin\PycharmProjects\friture\friture\plotting\glCanvasWidget.py", line 171, in tryGlGetIntegerv
return GL.glGetIntegerv(enum)
File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.call
File "src/wrapper.pyx", line 303, in OpenGL_accelerate.wrapper.Wrapper.call
File "src/wrapper.pyx", line 88, in OpenGL_accelerate.wrapper.CArgCalculator.c_call
File "src/wrapper.pyx", line 69, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/wrapper.pyx", line 64, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/arraydatatype.pyx", line 355, in OpenGL_accelerate.arraydatatype.SizedOutputOrInput.c_call
File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\plugins.py", line 16, in load
return importByName( self.import_path )
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\plugins.py", line 38, in importByName
module = import( ".".join(moduleName), {}, {}, moduleName)
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\arrays\numpymodule.py", line 28, in
from OpenGL_accelerate.numpy_formathandler import NumpyHandler
File "init.pxd", line 242, in init OpenGL_accelerate.numpy_formathandler
ValueError: ('numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject', 1, <OpenGL.platform.baseplatform.glGetIntegerv object at 0x000001C37BA47740>)
2021-05-17 18:51:25,013 INFO friture.plotting.glCanvasWidget: Intel, Intel(R) UHD Graphics, Version: 4.6.0 - Build 27.20.100.8681, Shaders: 4.60 - Build 27.20.100.8681, Extensions: unknown
2021-05-17 18:51:25,034 CRITICAL friture.exceptionhandler: Unhandled exception: Traceback (most recent call last):
File "C:\Users\admin\PycharmProjects\friture\friture\plotting\glCanvasWidget.py", line 230, in initializeGL
quad_vertex_shader = GL.shaders.compileShader(vertex_shader_source, GL.GL_VERTEX_SHADER)
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\GL\shaders.py", line 231, in compileShader
result = glGetShaderiv( shader, GL_COMPILE_STATUS )
File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.call
File "src/latebind.pyx", line 51, in OpenGL_accelerate.latebind.Curry.call
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\GL\VERSION\GL_2_0.py", line 268, in glGetShaderiv
status = arrays.GLintArray.zeros( (1,))
File "src/arraydatatype.pyx", line 219, in OpenGL_accelerate.arraydatatype.ArrayDatatype.zeros
File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\plugins.py", line 16, in load
return importByName( self.import_path )
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\plugins.py", line 38, in importByName
module = import( ".".join(moduleName), {}, {}, moduleName)
File "D:\ProgramData\miniconda3\envs\friture\lib\site-packages\OpenGL\arrays\numpymodule.py", line 28, in
from OpenGL_accelerate.numpy_formathandler import NumpyHandler
File "src/numpy_formathandler.pyx", line 39, in init OpenGL_accelerate.numpy_formathandler
AttributeError: type object 'OpenGL_accelerate.numpy_formathandler.NumpyHandler' has no attribute 'reduce_cython'

the total log:
friture.log.txt

my python env:
anaconda3 + python3.9.1

image

thanks!

@reductionista
Copy link
Contributor

I get the same error when I try to run the latest friture on MacOS Big Sur 11.3.1

2021-06-19 00:17:40,515 INFO friture.analyzer: Friture 0.45 starting on Darwin (darwin)
2021-06-19 00:17:40,635 INFO friture.analyzer: Applying Mac OS-specific setup
2021-06-19 00:17:40,635 INFO friture.analyzer: Adding the following to the Library paths: /usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/PlugIns
2021-06-19 00:17:40,854 INFO friture.audiobackend: Initializing audio backend
2021-06-19 00:17:40,855 INFO friture.audiobackend: Found 6 input devices and 7 output devices
2021-06-19 00:17:40,913 INFO friture.audiobackend: Supported formats for 'Built-in Microphone' on 'Core Audio': ['22050 Hz, float32', '22050 Hz, int16', '22050 Hz, int8', '44100 Hz, float32', '44100 Hz, int16', '44100 Hz, int8', '48000 Hz, float32', '48000 Hz, int16', '48000 Hz, int8', '96000 Hz, float32', '96000 Hz, int16', '96000 Hz, int8']
2021-06-19 00:17:40,913 INFO friture.audiobackend: Opening the stream for device 'Built-in Microphone'
2021-06-19 00:17:40,916 INFO friture.audiobackend: Device claims 108 ms latency
2021-06-19 00:17:41,578 INFO friture.audiobackend: Success
2021-06-19 00:17:41,601 INFO friture.dockmanager: First launch, display a default set of docks
2021-06-19 00:17:41,603 INFO friture.audioproc: audioproc: updating self.freq cache
2021-06-19 00:17:41,603 INFO friture.audioproc: audioproc: updating window
2021-06-19 00:17:41,603 INFO friture.audioproc: audioproc: updating self.freq cache
2021-06-19 00:17:41,604 INFO friture.audioproc: audioproc: updating window
2021-06-19 00:17:41,611 INFO friture.spectrogram_image: palette preparation
2021-06-19 00:17:41,614 INFO friture.audioproc: audioproc: updating self.freq cache
2021-06-19 00:17:41,614 INFO friture.audioproc: audioproc: updating window
2021-06-19 00:17:41,614 INFO friture.audioproc: audioproc: updating self.freq cache
2021-06-19 00:17:41,614 INFO friture.audioproc: audioproc: updating window
2021-06-19 00:17:41,615 INFO friture.signal.frequency_resampler: freq scale changed to 1.000000
2021-06-19 00:17:41,615 INFO friture.signal.frequency_resampler: freq range changed 20.000000 24000.000000
2021-06-19 00:17:41,621 INFO friture.analyzer: Timer start
2021-06-19 00:17:41,621 INFO friture.analyzer: Init finished, entering the main loop
2021-06-19 00:17:42,856 INFO friture.plotting.glCanvasWidget: OpenGL format: version 4.1, Core profile, Desktop OpenGL rendering
2021-06-19 00:17:42,860 ERROR friture.plotting.glCanvasWidget: glGetIntegerv failed
Traceback (most recent call last):
File "/Users/dominovaldano/workspace/friture/friture/plotting/glCanvasWidget.py", line 171, in tryGlGetIntegerv
return GL.glGetIntegerv(enum)
File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.call
File "src/wrapper.pyx", line 303, in OpenGL_accelerate.wrapper.Wrapper.call
File "src/wrapper.pyx", line 88, in OpenGL_accelerate.wrapper.CArgCalculator.c_call
File "src/wrapper.pyx", line 69, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/wrapper.pyx", line 64, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/arraydatatype.pyx", line 355, in OpenGL_accelerate.arraydatatype.SizedOutputOrInput.c_call
File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/plugins.py", line 16, in load
return importByName( self.import_path )
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/plugins.py", line 38, in importByName
module = import( ".".join(moduleName), {}, {}, moduleName)
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/arrays/numpymodule.py", line 28, in
from OpenGL_accelerate.numpy_formathandler import NumpyHandler
File "init.pxd", line 242, in init OpenGL_accelerate.numpy_formathandler
ValueError: ('numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject', 1, <OpenGL.platform.baseplatform.glGetIntegerv object at 0x13f3e4d40>)
2021-06-19 00:17:42,864 INFO friture.plotting.glCanvasWidget: ATI Technologies Inc., AMD Radeon Pro 560 OpenGL Engine, Version: 4.1 ATI-4.4.17, Shaders: 4.10, Extensions: unknown
2021-06-19 00:17:42,872 CRITICAL friture.exceptionhandler: Unhandled exception: Traceback (most recent call last):
File "/Users/dominovaldano/workspace/friture/friture/plotting/glCanvasWidget.py", line 230, in initializeGL
quad_vertex_shader = GL.shaders.compileShader(vertex_shader_source, GL.GL_VERTEX_SHADER)
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/GL/shaders.py", line 231, in compileShader
result = glGetShaderiv( shader, GL_COMPILE_STATUS )
File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.call
File "src/latebind.pyx", line 51, in OpenGL_accelerate.latebind.Curry.call
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 268, in glGetShaderiv
status = arrays.GLintArray.zeros( (1,))
File "src/arraydatatype.pyx", line 219, in OpenGL_accelerate.arraydatatype.ArrayDatatype.zeros
File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/plugins.py", line 16, in load
return importByName( self.import_path )
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/plugins.py", line 38, in importByName
module = import( ".".join(moduleName), {}, {}, moduleName)
File "/Users/dominovaldano/workspace/friture/buildenv/lib/python3.9/site-packages/OpenGL/arrays/numpymodule.py", line 28, in
from OpenGL_accelerate.numpy_formathandler import NumpyHandler
File "src/numpy_formathandler.pyx", line 39, in init OpenGL_accelerate.numpy_formathandler
AttributeError: type object 'OpenGL_accelerate.numpy_formathandler.NumpyHandler' has no attribute 'reduce_cython'
2021-06-19 00:17:43,358 INFO friture.ringbuffer: Ringbuffer: growing buffer for length 15360
2021-06-19 00:20:58,128 INFO friture.exceptionhandler: Try to continue
Segmentation fault: 11

python --version
Python 3.9.5
pip freeze
appdirs==1.4.4
cffi==1.14.5
docutils==0.16
-e git+https://github.com/tlecomte/friture.git@b4d74ad26b13db0efcacaabc3547e3929dd1d7b8#egg=friture
multipledispatch==0.6.0
numpy==1.19.3
pa-ringbuffer==0.1.4
pycparser==2.20
PyOpenGL==3.1.5
PyOpenGL-accelerate==3.1.5
PyQt5==5.15.3
PyQt5-Qt==5.15.2
PyQt5-sip==12.9.0
pyrr==0.10.3
rtmixer==0.1.2
six==1.16.0
sounddevice==0.4.1

@reductionista
Copy link
Contributor

Update:

I was able to fix the problem by manually upgrading to the latest numpy:

> pip3 install -U numpy
Requirement already satisfied: numpy in ./buildenv/lib/python3.9/site-packages (1.19.3)
Collecting numpy
  Using cached numpy-1.20.3-cp39-cp39-macosx_10_9_x86_64.whl (16.1 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.19.3
    Uninstalling numpy-1.19.3:
      Successfully uninstalled numpy-1.19.3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
friture 0.45 requires numpy==1.19.3, but you have numpy 1.20.3 which is incompatible.
Successfully installed numpy-1.20.3

ie. The version in requirements.txt (numpy==1.19.3) does not work, but version 1.20.3 does.

@tlecomte
Copy link
Owner

tlecomte commented May 5, 2024

So numpy has been updated, and besides Friture is no longer using pyopengl, but it's using QML instead. So I think we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants