"useNativeGamma" error and Pyglet error

1,364 views
Skip to first unread message

RIFAT AHMED

unread,
Feb 23, 2015, 11:46:25 AM2/23/15
to psychop...@googlegroups.com
This is the error I see whenever I try to run my PsychoPy experiment. A previous post mentioned reinstalling the computers graphic drivers but I have no idea how to do that. Any help would be awesome ASAP. Thank you!

The computer is updated with the new psychopy

##### Running: C:\Users\echua\Desktop\FOK Study\FOKSTUDY_TESTB_lastrun.py ######
saved data to u'C:\\Users\\echua\\Desktop\\FOK Study\\data/test_FOKSTUDY_TESTB_2015_Feb_23_1134.csv'
Traceback (most recent call last):
  File "C:\Users\echua\Desktop\FOK Study\FOKSTUDY_TESTB_lastrun.py", line 50, in <module>
    blendMode='avg', useFBO=True,
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.82.01-py2.7.egg\psychopy\visual\window.py", line 330, in __init__
    self._setupGL()
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.82.01-py2.7.egg\psychopy\visual\window.py", line 1412, in _setupGL
    self._setupPyglet()
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.82.01-py2.7.egg\psychopy\visual\window.py", line 1273, in _setupPyglet
    style=style)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\window\win32\__init__.py", line 131, in __init__
    super(Win32Window, self).__init__(*args, **kwargs)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\window\__init__.py", line 559, in __init__
    self._create()
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\window\win32\__init__.py", line 261, in _create
    self.context.attach(self.canvas)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\gl\win32.py", line 263, in attach
    super(Win32ARBContext, self).attach(canvas)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyglet\gl\win32.py", line 208, in attach
    raise gl.ContextException('Unable to share contexts')
pyglet.gl.ContextException: Unable to share contexts
Exception AttributeError: "'Window' object has no attribute 'useNativeGamma'" in <bound method Window.__del__ of <psychopy.visual.window.Window object at 0x08967E30>> ignored

Best,
Rifat

Joshua Peterson

unread,
Mar 4, 2015, 1:38:57 PM3/4/15
to psychop...@googlegroups.com
I got this error yesterday when I installed a very old version of my graphics driver. I eventually found a newer one, but even uninstalling my current driver and using the basic default Windows vga driver (this happens automatically if you uninstall your official driver) allowed me to use PsychoPy. You need to find out what video card you have. Do you have a laptop? Windows? OSX?

gab...@neuro.ufrn.br

unread,
May 29, 2015, 3:10:38 PM5/29/15
to psychop...@googlegroups.com
I have too this problem. I´m using WINDOWS XP and I try install in windows 7, but ocurred this error!!!

Help me!

Jeremy Gray

unread,
May 29, 2015, 3:33:57 PM5/29/15
to psychop...@googlegroups.com
Did you try to update your graphics drivers? Do not rely on the Windows ones, nor rely on Windows to tell you if the graphics drivers are up to date. Visit the website of the card manufacturer (like: Nvidea), and probably they have a tool there to check you drivers, and instructions on how to update them.

--Jeremy

--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/f5bd4c55-c332-41b6-9b18-e76166a1233f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Linus Sun

unread,
Jul 11, 2015, 2:12:14 AM7/11/15
to psychop...@googlegroups.com
No amount of updating your drivers will solve this! I got the same error!

Try this:

1. Go to "c:\Program Files (x86)\PsychoPy2\Lib\site-packages" and change the name of pyglet folder to pyglet1.2.
2. Then change the name of pyglet1.1.4 to pyglet (this is the correct version of pyglet that should have been loaded, somehow the pyglet 1.2 alpha was chosen as the default instead.
3. Benchmarking demo works again for me.

According to the PsychoPy installation documentation, pyglet version 1.1.4 is the one that is supported while you should NOT use the 1.2 version. However in the Standalone installations of psychopy (1.82.00 and 1.82.01 I tested so far) in the modules folder of psychopy (for me that would be on Windows 7 64 bit: "c:\Program Files (x86)\PsychoPy2\Lib\site-packages" the working pyglet module 1.1.4 was RENAMED to pyglet1.1.4 while the pyglet 1.2 alpha became the default 'pyglet' module.

I discovered this when going to code view and running the sysInfo.py demo. 

I suggest that the pyglet 1.1.4 become the default again, and leave the 1.2alpha version out.

--Linus

Jon Peirce

unread,
Jul 12, 2015, 7:22:54 AM7/12/15
to psychop...@googlegroups.com
Interesting that this is only a problem in pyglet 1.2. We aren't going to simply revert PsychoPy to the older version I'm afraid - that's no longer developed - so the aim is to work out why the pyglet 1.2 lib is raising an error. I'm afraid I don't have that problem on my own machines, where pyglet 1.2 is now working perfectly well.
Could you tell us what graphics card and driver version you have (or provide the output from the sysInfo "demo"). Thanks

In the past when this error came up on pyglet 1.1.4, due to a crumby graphics card or microsoft graphics driver, it could be circumvented by setting an environment variable:
     PYGLET_SHADOW_WINDOW=0
so that could be a workaround to try

cheers,
Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Jon Peirce
http://www.peirce.org.uk

LisaLondon

unread,
Jul 22, 2015, 7:39:02 AM7/22/15
to psychopy-users
Thank you very much for this tip! Had the same problem this morning and thanks to you, it was fixed within 10 seconds :)

Akos Szekely

unread,
Sep 29, 2015, 5:18:55 PM9/29/15
to psychopy-users
Hello all,

I am running into this problem as well, though it is more resistant to the fixes mentioned so far.
I have six computers in a lab that I want to install psychopy on, and three of them work successfully, but three do not.  I have copied over installations that worked on other machines, but on these three computers nothing works.
I am fairly certain that this is a result of the non-compliant machines being on Windows Vista and the other machines being on Windows 7.  The graphics card here is an ATI Radeon 3450 and I've attempted to update it, but to no avail.
I have attempted the fixes mentioned here, including the changing of pyglet (AccessInit: hash collision: 3 for both 1 and 1), and the environmental variable (doesn't fix anything).
Here's the output from sysInfo:
Windows-Vista-6.0.6002-SP2

Python info
WinPython-32bit-2.7.10.2\python-2.7.10\pythonw.exe
2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
numpy 1.9.2
scipy 0.16.0
matplotlib 1.4.3
pyglet 1.2.4
pyo [not installed]

PsychoPy 1.82.01

The rest fails due to needing to open a window.

Conal

unread,
Mar 22, 2016, 10:17:09 AM3/22/16
to psychopy-users
Thanks Linus,

Ran into the same issue after updating the drivers but your suggestion worked.

--Conal

Jonathan Peirce

unread,
Mar 22, 2016, 1:06:56 PM3/22/16
to psychop...@googlegroups.com
Interesting issue. It is to do with specific graphics cards/drivers and I haven't personally had an issue on my own machines so can't debug. Thanks Linus for providing the workaround. I've previously mentioned the other workaround of turning off Window Shadowing in pyglet. Did you try that?

The thing is that pyglet v1.2 provides a number of other advantages (like working joysticks, a mouse that can have its position set, python3 support) so I don't want us to revert to 1.1.4 if we can avoid it.

Maybe upgrading further to 1.2.4 is the solution? The issue has been discussed on the pyglet forum, relating to Intel graphics cards not supporting a particular window type.
    https://groups.google.com/forum/#!topic/pyglet-users/44pS-xkoObI
So maybe in even newer versions of pyglet it detects that this will fail and avoid it?

You could try downloading pyglet from here
    https://pypi.python.org/pypi/pyglet
and drag the enclosed pyglet folder from the zip file to your site-packages (I would do the same as before; keep your existing pyglet packages but append their version names so they'll be ignored and leave this one with no version name). I'd be keen to know if 1.2.4 fixes the problem.

best wishes
Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
University of Nottingham

http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

Conal

unread,
Jun 13, 2016, 6:00:59 AM6/13/16
to psychopy-users
Hi Akos,

Did you correct this issue you had? We've just installed the exact same video card as you here and have ran into similar territory with resistance to the suggested fixes.

Many thanks,

Conal

Akos Szekely

unread,
Jun 13, 2016, 12:09:59 PM6/13/16
to psychopy-users
Hello Conal,

I came up with two solutions, one more permanent than the other. 
First I switched to pygame, which made everything look weird and messed with the proportions of my stimuli but at least it functioned. 
I upgraded to Windows 7 on all my computers, which made most of them work, and for the ones that didn't, I had the university IT guy come by and clone the functioning machines' onto the malfunctioning machines.  This was all with pyglet, rather than pygame.  That option still works in case of emergency, but isn't ideal.  At this point I'm just trying not to change anything and hope it still keeps working.


Best,
Akos Szekely

Conal

unread,
Jun 16, 2016, 8:07:23 AM6/16/16
to psychopy-users
Hi Akos,

Success finally! Uninstalled Windows 10, reinstalled windows 7 and with a few other adjustments it worked. I did not install pygame and we did not need to video card in the end but thanks for your suggestions.

Conal

Jonathan Peirce

unread,
Jun 16, 2016, 12:56:27 PM6/16/16
to psychop...@googlegroups.com
Still sounds like a driver issue to me. I wonder whether Win10 was somehow blocking the ATI driver that you installed. Wait, when you say "attempted to update it, but to no avail" does that mean you /didn't/ update the video drivers? So you were still using the Windows graphics drivers?
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

Akos Szekely

unread,
Jun 16, 2016, 3:07:18 PM6/16/16
to psychopy-users
Well, I attempted to update by clicking the drivers and using Windows' search for new drivers, but that yielded the same driver I had.  I then went and searched for a site affiliated with ATI Radeon (which had been absorbed into another company, apparently) and used the drivers I found there, but even that didn't do anything

Jonathan Peirce

unread,
Jun 17, 2016, 5:28:12 AM6/17/16
to psychop...@googlegroups.com
Thanks for the info.

Yes, ATI is now owned by AMD and going to the website to install the driver is the way to go if you have an ATI card. Asking windows to update the driver itself will just get you another microsoft driver and that will always have poor OpenGL support.

You'll need to restart after that's been installed. I do hope it isn't the case that win10 is going to prevent AMD/ATI users from accessing this :-(

Jon

For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
University of Nottingham

http://www.peirce.org.uk
Reply all
Reply to author
Forward
0 new messages