expyriment icon indicating copy to clipboard operation
expyriment copied to clipboard

Expyriment 0.11.dev1: missing png files and

Open chrplr opened this issue 1 year ago • 12 comments

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

chrplr avatar Dec 09 '23 19:12 chrplr

Thanks a lot for the feedback.

Please note, the ".dev" versions on the master branch might be broken. They are not tested and might not work.

We are about to switch to flit for the packaging to simplify our release process. We want to have much shorter release cycles.

If you need to install the dev-version of the master branch, you should call "flit install" from the repository directory. I think, the current master branch should work with flit.

Flit: https://flit.pypa.io/en/stable/

Greetings, Oliver

Christophe Pallier @.***> schrieb am Sa., 9. Dez. 2023, 20:04:

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 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

— Reply to this email directly, view it on GitHub https://github.com/expyriment/expyriment/issues/214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQZZZQ76L3ZHXJ65VAW5ZTYISYZXAVCNFSM6AAAAABAN7K2R2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTGOJYGU4TENA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lindemann09 avatar Dec 11 '23 04:12 lindemann09

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

visserle avatar Jan 22 '24 10:01 visserle

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

lindemann09 avatar Jan 23 '24 10:01 lindemann09

Great, I'm already looking forward to it.

visserle avatar Jan 23 '24 11:01 visserle

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.

visserle avatar Jan 30 '24 15:01 visserle

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

fladd avatar Jan 30 '24 15:01 fladd

@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?

fladd avatar Jan 30 '24 15:01 fladd

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.

visserle avatar Jan 30 '24 15:01 visserle

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

fladd avatar Jan 30 '24 15:01 fladd

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.)

visserle avatar Jan 30 '24 15:01 visserle

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).

fladd avatar Jan 30 '24 15:01 fladd

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

visserle avatar Jan 30 '24 15:01 visserle