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

Expyriment 0.11.dev1: missing png files and #214

Open
chrplr opened this issue Dec 9, 2023 · 12 comments
Open

Expyriment 0.11.dev1: missing png files and #214

chrplr opened this issue Dec 9, 2023 · 12 comments

Comments

@chrplr
Copy link
Contributor

chrplr commented Dec 9, 2023

Hello,

  • Seing that there were recent commits, I tried a
pip install git+https://github.com/expyriment/expyriment.git

in an environment with python 3.12.0 (installed with pyenv, under Ubuntu 22.04)

This succeeded:

 Successfully installed expyriment-0.0.0 pygame-2.5.2 pyopengl-3.1.6

(note the tiny issue with the version number of expyriment;
When I import expyriment in ipython, the version displayed is 0.11.dev1.)

  • A first small issue:

expyriment -T crashed because of missing xpy_icon.png

  File "/home/cp983411/.pyenv/versions/3.12.0/envs/expyriment2/lib/python3.12/site-packages/expyriment/io/_screen.py", line 107, in __init__
    icon = pygame.image.load(os.path.join(os.path.split(__file__)[0],
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: No such file or directory: '/home/cp983411/.pyenv/versions/3.12.0/envs/expyriment2/lib/python3.12/site-packages/expyriment/io/../xpy_icon.png'.

I needed to manually copy there the file xpy_icon.png, as well as expyriment_logo.png

  • ANother issue that your module seems to require numpy but it is not in the dependencies:
Unable to import OpenGL.arrays.numpymodule.NumpyHandler: No numpy module present: No module named 'numpy'

(this disappeared after a pip install numpy)

  • Yet when I try to launch a script experiment, it crashes:
Expyriment 0.11.dev1 (Python 3.12.0) 
Main file: lexical-decision.py (90ffb2)
Warning: OpenGL mode '2' does not exist.                 OpenGL will be set to '2' (default)
dict_keys([<class 'numpy.ndarray'>, <class 'bytes'>])
Traceback (most recent call last):
  File "/home/cp983411/00_git/PCBS/experiments/lexical-decision/lexical-decision.py", line 16, in <module>
    expyriment.control.initialize(exp)
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/expyriment/control/_experiment_control.py", line 495, in initialize
    canvas.preload(True)
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/expyriment/stimuli/_visual.py", line 1068, in preload
    self._ogl_screen = _LaminaPanelSurface(
                       ^^^^^^^^^^^^^^^^^^^^
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/expyriment/stimuli/_visual.py", line 79, in __init__
    self.refresh_position()
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/expyriment/stimuli/_visual.py", line 109, in refresh_position
    bottomleft = oglu.gluUnProject(screensize[0] // 2 - \
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/OpenGL/latebind.py", line 63, in __call__
    return self.wrapperFunction( self.baseFunction, *args, **named )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cp983411/.pyenv/versions/expyriment2/lib/python3.12/site-packages/OpenGL/GLU/projection.py", line 55, in gluUnProject
    result = baseFunction( 
             ^^^^^^^^^^^^^
ctypes.ArgumentError: argument 7: TypeError: No array-type handler for type _ctypes.CArgObject (value: <cparam 'P' (0x7fe26b53b2a0)>) registered
@lindemann09
Copy link
Member

lindemann09 commented Dec 11, 2023 via email

@visserle
Copy link

Hi,
Using flit, I get the same errors as chrplr.
Are you planning to release a stable version soon?
I would like to try it out!
Best

@lindemann09
Copy link
Member

Yes, we war planning to release a stable version in the next week. We'll keep you posted.

@visserle
Copy link

Great, I'm already looking forward to it.

@visserle
Copy link

Good news, I got the master branch version running on my M2 (Python 3.11.7, mamba) by first installing pygame following the pygame MacCompile instructions, installing expyriment via pip install git and finally adding the two missing .png files.

@fladd
Copy link
Member

fladd commented Jan 30, 2024

@visserle Compiling pygame should not be necessary, as there are wheels available on Pypi. Is this not the case for ARM64-macs?

@fladd
Copy link
Member

fladd commented Jan 30, 2024

@visserle Compiling pygame should not be necessary, as there are wheels available on Pypi. Is this not the case for ARM64-macs?

just checked, there is a wheel available!

Do you get an error when just installing with PIP?

@visserle
Copy link

Now everything is working fine and I can't reproduce the error from my original post. In the meantime, I tried to install expyriment 0.10 with python 3.8 and pygame 1.9.6, which failed on my machine due to a missing SDL.h. I then installed the "MacCompile" which added SDL modules via homebrew, but this didn't fix the error. I then tried to install the dev version of expyriment with pygame > 2.0 a second time - it suddenly worked and the error from my very first attempt no longer occurred.

@fladd
Copy link
Member

fladd commented Jan 30, 2024

Expyriment 0.10.0 is only compatible with Python <=3.7.
Expyriment 0.11.0 will be compatible with Python >= 3.8.

@visserle
Copy link

To clarify, the missing SDL.h error occured when pip install pygame==1.9.6. This might not be related to expyriment. (Also in #211 you reported using expyriment 0.10 with python 3.8.)

@fladd
Copy link
Member

fladd commented Jan 30, 2024

Yes, the error occurs because there are not Pygame 1.9.6 wheels on Pypi for that Python version. It hence then tries to build Pygame, but fails, probably because you don't have the needed header files for SDL. We do not recommend to build Pygame from source and hence state that Expyriment 0.10.0 is only compatible with Python<=3.7 (i.e. Python versions for which wheels are available). My response in #211 seems to be a typo (or maybe I used a development version of Expyriment, since nothing was changed since 0.10.0 with respect to stimulus scaling).

@visserle
Copy link

Good to know. I'm excited that I can now work with Expyriment on my machine!

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

No branches or pull requests

4 participants