0

I'm new to VisPy and was able to run the vispy.test() and spectrogram.py example via Anaconda3 prompt. The problem is when I try to use it inside Spyder IDE.

Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.8.0 -- An enhanced Interactive Python.

import vispy

print(vispy.sys_info())
Platform: Windows-10-10.0.18362-SP0
Python:   3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
NumPy:    1.16.5
Backend:  ipynb_webgl
pyqt4:    None
pyqt5:    ('PyQt5', '5.9.2', '5.9.6')
pyside:   None
pyside2:  None
pyglet:   None
glfw:     None
sdl2:     None
wx:       None
egl:      None
osmesa:   None
_test:    None

GL version:  ''
MAX_TEXTURE_SIZE: ()
Extensions: ''
App info-gathering error:
Traceback (most recent call last):
  File "C:\Users\Pedro\Anaconda3\lib\site-packages\vispy\util\config.py", line 438, in sys_info
    canvas.close()
  File "C:\Users\Pedro\Anaconda3\lib\site-packages\vispy\app\canvas.py", line 457, in close
    self._backend._vispy_close()
  File "C:\Users\Pedro\Anaconda3\lib\site-packages\vispy\app\backends\_ipynb_webgl.py", line 203, in _vispy_close
    raise NotImplementedError()
NotImplementedError

Nevertheless, If I do:

%gui qt

import vispy

vispy.use('pyqt5')

print(vispy.sys_info())
Platform: Windows-10-10.0.18362-SP0
Python:   3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
NumPy:    1.16.5
Backend:  PyQt5
pyqt4:    None
pyqt5:    ('PyQt5', '5.9.2', '5.9.6')
pyside:   None
pyside2:  None
pyglet:   None
glfw:     None
sdl2:     None
wx:       None
egl:      None
osmesa:   None
_test:    None

GL version:  '4.6.0 NVIDIA 432.00'
MAX_TEXTURE_SIZE: 16384
Extensions: 'GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage ...

So, the PyQt5 backend is being used now, and Spectrogram.py executes! But I get the same error when executing vispy.test():

----------------------------------------------------------------------
msg:
_VISPY_TESTING_APP=pyqt5 C:\Users\Pedro\Anaconda3\pythonw.exe -m pytest -m vispy_app_test C:\Users\Pedro\Anaconda3\lib\site-packages\vispy
Failed: unit failure (1)
----------------------------------------------------------------------

If the example executes, I guess the test might not be that important...

Anyway, how to run the vispy.test() inside Spyder IDE? And any advice on developing vispy code in Spyder?

Pedro
  • 330
  • 2
  • 12

2 Answers2

2

There should be a new version of vispy released last week (0.6.5) which should be installable and not require the C++ tools.

However, I think the main issue is that the way Spyder uses Jupyter/python kernels makes vispy think it is in a jupyter notebook and it defaults to the webgl backend. If you explicitly say vispy.app.use('pyqt5') or some other similar backend, your code should run in spyder.

djhoese
  • 3,567
  • 1
  • 27
  • 45
0

What brought me a step further was:

pip install nose

from the powershell (I'm using WinPython)...

the vispy.test() then runs without errors, and I can see various windows of different sizes poping up briefly, but all black and no actual test running.

I guess one more piece of the puzzle is missing.

Pulling the latest GIT development version is not an option for me (tried it already), because it requires Microsoft C++ Build Tools, which I'm not allowed to install on this machine...

Bitstream
  • 111
  • 1
  • 6