baseplatform.py problem

38 views
Skip to first unread message

Bruce Weaver

unread,
Feb 3, 2009, 11:57:18 AM2/3/09
to psychopy-users
Hello group. I'm a newcomer to PsychoPy, and have run into a problem
when I run the Monitor Center tool. Here's the output (my apologies
if there is any nasty line-wrap):

Welcome to the Integrated Development Environment (IDE) for PsychoPy!
v0.96.01
Traceback (most recent call last):
File "C:\Python25\lib\site-packages\psychopyIDE\PsychoPyIDE.py",
line 1819, in openMonitorCenter
from monitors import MonitorCenter
File "C:\Python25\lib\site-packages\monitors\__init__.py", line 2,
in <module>
import calibTools
File "C:\Python25\lib\site-packages\monitors\calibTools.py", line 5,
in <module>
import psychopy.visual #must be imported this way because of
mutual import
File "C:\Python25\Lib\site-packages\psychopy\visual.py", line 27, in
<module>
import OpenGL.GL, OpenGL.GL.ARB.multitexture
File "C:\Python25\lib\site-packages\OpenGL\GL\__init__.py", line 11,
in <module>
from OpenGL.GL.VERSION.GL_1_2 import *
File "C:\Python25\lib\site-packages\OpenGL\GL\VERSION\GL_1_2.py",
line 11, in <module>
from OpenGL.raw.GL.VERSION.GL_1_2 import *
File "C:\Python25\lib\site-packages\OpenGL\raw\GL\VERSION
\GL_1_2.py", line 87, in <module>
argNames = ('target', 'internalformat', 'width', 'format', 'type',
'table',),
File "C:\Python25\Lib\site-packages\OpenGL\platform
\baseplatform.py", line 134, in createBaseFunction
extension = extension,
File "C:\Python25\Lib\site-packages\OpenGL\platform
\baseplatform.py", line 106, in constructFunction
func.__doc__ = doc
UnboundLocalError: local variable 'func' referenced before assignment


Any thoughts on what to do about this? Is there a more recent version
of baseplatform.py I need to download? Any hints gratefully
received!

Cheers,
Bruce

p.s. - I have a Lenova ThinkPad running XP-Professional, and sitting
in a docking station, in case that matters.

--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."

Jon Peirce

unread,
Feb 4, 2009, 4:49:51 AM2/4/09
to psychop...@googlegroups.com
No this one is new to me. Have you got anything to work at all? Are you able to run the sys_info demo? If you can get that to run then please send us the output, so we can see more what is installed and what  drivers you have loaded.

thanks,
Jon

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.

Bruce Weaver

unread,
Feb 4, 2009, 9:39:38 AM2/4/09
to psychopy-users
On Feb 4, 4:49 am, Jon Peirce <jon.pei...@googlemail.com> wrote:
> No this one is new to me. Have you got anything to work at all? Are you able to run the sys_info demo? If you can get that to run then please send us the output, so we can see more what is installed and what  drivers you have loaded.
> thanks,
> Jon

Hi Jon. OK...here is the output from sys_info:

Welcome to the Integrated Development Environment (IDE) for PsychoPy!
v0.96.01

Running C:\Python25\lib\site-packages\psychopy\demos\sysInfo.py
Traceback (most recent call last):
File "C:\Python25\lib\site-packages\psychopy\demos\sysInfo.py", line
2, in <module>
from psychopy import visual
File "C:\Python25\Lib\site-packages\psychopy\visual.py", line 3, in
<module>
import psychopy.misc
File "C:\Python25\Lib\site-packages\psychopy\misc.py", line 7, in
<module>
import monitors
File "C:\Python25\lib\site-packages\monitors\__init__.py", line 2,
in <module>
import calibTools
File "C:\Python25\lib\site-packages\monitors\calibTools.py", line
13, in <module>
import scipy.optimize as optim
ImportError: No module named scipy.optimize


Looks like there is some problem with calibTools.py.

Jonathan Peirce

unread,
Feb 4, 2009, 12:33:33 PM2/4/09
to psychop...@googlegroups.com
Actually, I'm wondering if you have all the dependencies/drivers properly installed. This message suggests that scipy hasn't been installed fully (or that you are using a different version to the ones I've tested on). Do you know which version you installed?

The previous post might result from no OpenGL drivers. Have you fetched the latest drivers for you graphics card?

Jon

Bruce Weaver

unread,
Feb 4, 2009, 2:57:48 PM2/4/09
to psychopy-users
Line-wrap isn't working properly in this window, so
I'll insert hard returns and hope it all works out!

On Feb 4, 12:33 pm, Jonathan Peirce <jon.pei...@googlemail.com> wrote:
> Actually, I'm wondering if you have all the dependencies/drivers
properly installed. This message suggests that scipy hasn't been
installed fully (or that you are using a different version to the
ones
I've tested on). Do you know which version you installed?

Installation file: scipy-0.7.0rc2-win32-superpack-python2.5.exe
From: http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531

> The previous post might result from no OpenGL drivers.
Have you fetched the latest drivers for you graphics card?
> Jon

Yes, I did update the drivers. But maybe the video card is
inadequate.
It's the Mobile Intel(R) 965 Express Chipset. The system info
output shows two of them, actually.

Thanks Jon.
Bruce

Jonathan Peirce

unread,
Feb 6, 2009, 9:20:56 AM2/6/09
to psychop...@googlegroups.com
Well, it's a puzzle. That looks like the right package, and scipy documentation shows no sign that optimize has moved as a sub-package. That command has worked before and should still work. I could change calibtools so that it silently ignores errors there and just warns you that gamma calibrations won't be possible.
http://psychopy.googlecode.com/svn/trunk/monitors/calibTools.py

None of this addresses the previous opengl error you were getting - i still don't understand that one. I have run psychopy off a winXP machine with that chipset and it did work (maybe with a pyglet window instead of pygame, though).

For sure integrated Intel graphics are far from ideal - for one thing they don't allow syncing to the vertical blank, so frame rates are not precisely timed. Generally not suitable for experiments. But they should work to some extent.

Jon


Bruce Weaver wrote:

Installation file: scipy-0.7.0rc2-win32-superpack-python2.5.exe
From:  http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531

  
The previous post might result from no OpenGL drivers.
    
Have you fetched the latest drivers for you graphics card?
  
Jon
    
Yes, I did update the drivers.  But maybe the video card is
inadequate.
It's the Mobile Intel(R) 965 Express Chipset.  The system info
output shows two of them, actually.

  

Bruce Weaver

unread,
Feb 6, 2009, 3:21:09 PM2/6/09
to psychopy-users
On Feb 6, 9:20 am, Jonathan Peirce <jonathan.pei...@nottingham.ac.uk>
wrote:
> Well, it's a puzzle. That looks like the right package, and scipy documentation shows no sign that optimize has moved as a sub-package. That command has worked before and should still work. I could change calibtools so that it silently ignores errors there and just warns you that gamma calibrations won't be possible.http://psychopy.googlecode.com/svn/trunk/monitors/calibTools.py
> None of this addresses the previous opengl error you were getting - i still don't understand that one. I have run psychopy off a winXP machine with that chipset and it did work (maybe with a pyglet window instead of pygame, though).
> For sure integrated Intel graphics are far from ideal - for one thing they don't allow syncing to the vertical blank, so frame rates are not precisely timed. Generally not suitable for experiments. But they should work to some extent.
> Jon


OK, I've now figured out the source of the second problem I ran into
(i.e., ImportError: No module named scipy.optimize). I did download
the scipy installer, but it seems I then failed to run it. D'oh!!
Now that I've actually installed scipy, I no longer get that error.
(Yes, I am hanging my head in shame.)

However, all is not well, because now everything grinds to a halt when
I encounter the same problem as before (when trying to run the Monitor
Center tool). Here's my current output from sysInfo.py:

Welcome to the Integrated Development Environment (IDE) for PsychoPy!
v0.96.01

Running C:\Python25\lib\site-packages\psychopy\demos\sysInfo.py
Traceback (most recent call last):
File "C:\Python25\lib\site-packages\psychopy\demos\sysInfo.py", line
2, in <module>
from psychopy import visual
File "C:\Python25\Lib\site-packages\psychopy\visual.py", line 27, in
<module>
import OpenGL.GL, OpenGL.GL.ARB.multitexture
File "C:\Python25\lib\site-packages\OpenGL\GL\__init__.py", line 11,
in <module>
from OpenGL.GL.VERSION.GL_1_2 import *
File "C:\Python25\lib\site-packages\OpenGL\GL\VERSION\GL_1_2.py",
line 11, in <module>
from OpenGL.raw.GL.VERSION.GL_1_2 import *
File "C:\Python25\lib\site-packages\OpenGL\raw\GL\VERSION
\GL_1_2.py", line 87, in <module>
argNames = ('target', 'internalformat', 'width', 'format', 'type',
'table',),
File "C:\Python25\Lib\site-packages\OpenGL\platform
\baseplatform.py", line 134, in createBaseFunction
extension = extension,
File "C:\Python25\Lib\site-packages\OpenGL\platform
\baseplatform.py", line 106, in constructFunction
func.__doc__ = doc
UnboundLocalError: local variable 'func' referenced before assignment

So...back to where we started!

Cheers,

Bruce Weaver

unread,
Feb 6, 2009, 4:05:27 PM2/6/09
to psychopy-users
I received this from a friend who uses Python:

--- start of message ---

This is an error in the last file mentioned in the traceback:

C:\Python25\Lib\site-packages\OpenGL\platform\baseplatform.py"

line 106, in constructFunction
> func.__doc__ = doc
> UnboundLocalError: local variable 'func' referenced before assignment
>

The error actually occurs in the if/else constructs between lines
93-97
where one of the AttributeError lines is missing the 'raise' cmd. If
you
add in the missing 'raise' and save the file it should now work.
Before
running a demo you should delete the pre-existing compiled version of
this file 'baseplatform.pyc'. A new one will be created when
baseplatform.py is next used.

--- end of message ---

As he says, "raise" was missing from line 94 in my baseplatform.py
file. When I added it, everything worked. So my output from sysInfo
now looks like this:

Welcome to the Integrated Development Environment (IDE) for PsychoPy!
v0.96.01

Running C:\Python25\lib\site-packages\psychopy\demos\sysInfo.py
System info:
Windows-XP-5.1.2600-SP3

Python info
C:\Python25\pythonw.exe
2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]
numpy 1.2.1
scipy 0.7.0rc2
matplotlib 0.98.5.2
pyglet 1.1.2
PsychoPy 0.96.01
configured pyglet screen 0

OpenGL info:
vendor: Intel
rendering engine: Intel 965/963 Graphics Media Accelerator
OpenGL version: 2.0.0 - Build 7.15.10.5002
(Selected) Extensions:
True GL_ARB_multitexture
True GL_EXT_framebuffer_object
True GL_ARB_fragment_program
True GL_ARB_shader_objects
True GL_ARB_vertex_shader
True GL_ARB_texture_non_power_of_two
False GL_ARB_texture_float

The Monitor Center tool now runs too.

So...thanks for your help Jon.

Jonathan Peirce

unread,
Feb 9, 2009, 6:45:33 AM2/9/09
to psychop...@googlegroups.com
Good info bruce, thanks.

Again, though, just beware that those chips don't seem to support frame sync-ing under windows, so are not a good option where timing is important. On OS X the driver support seems better, they just aren't super-fast.

best wishes,
Jon
-- 
Dr. Jonathan Peirce
Associate Professor
Nottingham Visual Neuroscience
School of Psychology
Nottingham University

+44 (0)115 8467176 (tel)
http://www.peirce.org.uk/

da...@davebritton.com

unread,
Feb 9, 2009, 10:46:40 PM2/9/09
to psychop...@googlegroups.com, Jonathan Peirce
This is the first time I've needed to use jpg image displays, and I'm
getting this error even from the face_jpg.py demo, and I can't seem to
get around it:
configured pyglet screen 0

Traceback (most recent call last):
File "face_jpg.py", line 12, in ?
sf=(1.0, 1.0))
File
"c:\python24\lib\site-packages\PsychoPy-0.96.01-py2.4.egg\psychopy\visual
.py", line 1229, in __init__
File
"c:\python24\lib\site-packages\PsychoPy-0.96.01-py2.4.egg\psychopy\visual
.py", line 1249, in setTex
File
"c:\python24\lib\site-packages\PsychoPy-0.96.01-py2.4.egg\psychopy\visual
.py", line 3469, in createTexture
IndexError: tuple index out of range

I can't get any PatchStim objects to work in my own code.
I'm running on an IBM thinkpad with XP
Python 2.4, Psychopy .96.01

I have a presentation at 4pm GMT on Tuesday where I'm hoping to make
psychopy shine, with pictures (256x256 jpg's) displayed along with
sounds and text.

Any suggestions?
Thanks!
-Dave Britton

Reply all
Reply to author
Forward
0 new messages