| Reference | Downloads | Github

Problem creating visual.Window() in Spyder (python 3.6) psychopy 1.90.1 pyglet>1.3.0b1

Not sure if this is a bug report for PsychoPy - more of an FYI on what I’ve found:

I’m having a problem simply creating a Window from inside Spyder. After a little digging, I found that the problem is with pyglet versions > 1.3.0b1. Here’s what I get

Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 6.1.0 -- An enhanced Interactive Python.

from psychopy import visual

Traceback (most recent call last):

  File "<ipython-input-2-24b96ad64581>", line 1, in <module>

  File "C:\Users\timothy.j.williams1\Anaconda3\lib\site-packages\psychopy\visual\", line 375, in __init__
    self.backend = backends.getBackend(win=self, *args, **kwargs)

  File "C:\Users\timothy.j.williams1\Anaconda3\lib\site-packages\psychopy\visual\backends\", line 32, in getBackend
    return Backend(win, *args, **kwargs)

  File "C:\Users\timothy.j.williams1\Anaconda3\lib\site-packages\psychopy\visual\backends\", line 102, in __init__
    allScrs = defDisp.get_screens()

  File "C:\Users\timothy.j.williams1\Anaconda3\lib\site-packages\pyglet\canvas\", line 65, in get_screens
    raise NotImplementedError('abstract')

NotImplementedError: abstract

I was getting ready to post this before looking into pyglet, then I tried it from a PowerShell terminal (cmd terminals are disabled), and it worked fine. Everything is also fine with my python 2.7 environment (psychopy version 1.85.3, pyglet 1.2.4). I haven’t tried different pyglet versions there.

pyglet 1.3.2 works fine in my python 2.7 environment.

I have the same problem.

I tried to downgrade pyglet on py Python 3.6 env, but it automatically downgrade Python too.

I didn’t have that problem. How did you reinstall pyglet? Here’s what I did:

PS L:\> C:\Users\timothy.j.williams1\Anaconda3\python.exe -m pip install pyglet==1.3.0b1
Collecting pyglet==1.3.0b1
  Cache entry deserialization failed, entry ignored
  Using cached
Requirement already satisfied: future in c:\users\timothy.j.williams1\anaconda3\lib\site-packages (from pyglet==1.3.0b1)
Installing collected packages: pyglet
  Found existing installation: pyglet 1.3.2
    Uninstalling pyglet-1.3.2:
      Successfully uninstalled pyglet-1.3.2
Successfully installed pyglet-1.3.0b1
1 Like

I have the some problem.
Python 3.6.1, Psychopy 1.90.1, pyglet 1.3.1

If I downgrade pyglet to 1.3.0, it works fine. Hopefully psychopy experts can fix it soon.