Skip to content

"Unable to run "sdl-config"" during Linux installation (e.g. Ubuntu 20.04+) #178

Closed

Description

@lindemann09

Installing Expyriment (i.e. Pygame<1.9) requires under Debian also the manual installation of the package: libfreetype6-dev .

Documentation should be updated.

Activity

  1. fladd commented on Sep 17, 2021

    @fladd
    Member

    We should see if we can easily switch to Pygame 2. I intended to make that switch only as part of the next major version (i.e. 1.0), but we might want to release a 0.11.0 that supports it already sooner.

  2. lindemann09 commented on Nov 7, 2021

    @lindemann09
    MemberAuthor

    We should do that soon, because Expyriment is currently broken for Linux user. That is really bad.

  3. chrplr commented on Nov 7, 2021

    @chrplr
    Contributor

    My current workaround, for Ubuntu 20.04 LTS (using setup.py install from source, rather than pip install)
    Expyriment seems to be working fine with pygame2.0.3, but I have not checked extensively to be able to confirm that it does not break anoything.

    # install basic packages
    sudo apt install git 
    sudo apt install build-essential
    sudo apt install libportaudio2 libportmidi-dev
    sudo apt install  libsdl2-* 
    
    # Expyriment
    
    ## Download and install Anaconda Python
    wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
    chmod +x Anaconda3-2021.05-Linux-x86_64.sh
    ./Anaconda3-2021.05-Linux-x86_64.sh 
    conda update -n base -c defaults conda
    
    ## Expyriment environment
    conda create -n expyriment python=3.8
    conda activate expyriment
    conda install ipython numpy pyopengl
    pip install mediadecoder
    pip install sounddevice
    pip install pygame
    mkdir git
    cd git
    git clone https://github.com/expyriment/expyriment.git
    cd expyriment/
    python setup.py install
    
    # Checking expyriment
    conda activate epxyriment
    cd $HOME/git
    git clone https://github.com/chrplr/PCBS.git
    cd PCBS/experiments/expyriment/parity_decision
    python parity.py
    

    From my gist: https://gist.github.com/chrplr/61ec2de7f0e001ebf65aec89e6f6ddc9
    (On MacOSX: we temporally install pygame1.9.6 to satisfy pip install expyriment, then force upgrade to pygame2 (https://pcbs.readthhttps://pcbs.readthedocs.io/en/latest/software-installation.html#the-pygame-and-expyriment-python-modulesedocs.io/en/latest/software-installation.html#the-pygame-and-expyriment-python-modules)

  4. chrplr commented on Nov 8, 2021

    @chrplr
    Contributor

    Coming back to the issue with sdl-config. It is due to the installation of pygame missing the libsdl*1.2-dev packages.

  5. chrplr commented on Nov 8, 2021

    @chrplr
    Contributor

    Pygame2 relies on sdl2, where everything under the hood is using opengl. Maybe the pyopengl code in expyriment would no longer be necessary to achieve the same performance (?)

  6. fladd commented on Nov 8, 2021

    @fladd
    Member

    It might be possible. I have not looked at Pygame/SDL 2 yet. We mainly need OpenGL for blocking on the vertical retrace. If this is now possible in Pygame 2 natively, then indeed we might be able to drop OpenGL.

  7. lindemann09 commented on Mar 25, 2022

    @lindemann09
    MemberAuthor

    @fladd Have you had a look into it already? Would be great, if Exypriment is running again on Linux out of the box.

  8. chrplr commented on Mar 27, 2022

    @chrplr
    Contributor
  9. chrplr commented on Mar 27, 2022

    @chrplr
    Contributor
  10. lindemann09 commented on Mar 28, 2022

    @lindemann09
    MemberAuthor

    @chrplr thanks a lot for your comments.

    Yes, you are right we cannot say "expyriment is broken under Linux", just the pip installation is broken. It's just difficult to work with virtual environments, if you have to install pygame via apt. The upcoming version 0.11 should however solve all this issues.

  11. chrplr commented on Mar 28, 2022

    @chrplr
    Contributor
  12. fladd commented on Mar 28, 2022

    @fladd
    Member

    To be more precise, it seems to me that under Ubuntu, the issue occurs if one installs pygame with "pip install pygame" (which installs pygame2). Then one has the wrong libraries for SDL,... and dependency hell occurs ... Yet if one installs pygame with "apt install python3-pygame", 1.9.6 is installed with all the correct dependencies and "pip expyriment" works like a charm. (I have just installed it without problem on a pristine Ubuntu 20.04 distrib, following my own instructions at https://pcbs.readthedocs.io/en/latest/software-installation.html#instructions-for-linux-ubuntu-20-04 )
    …
    -- Christophe Pallier (http://www.pallier.org) INSERM Cognitive Neuroimaging Lab (http://www.unicog.org)
    On Mon, Mar 28, 2022 at 3:38 PM Oliver Lindemann @.> wrote: @chrplr https://github.com/chrplr thanks a lot for your comments. Yes, you are right we cannot say "expyriment is broken under Linux", just the pip installation is broken. It's just difficult to work with virtual environments, if you have to install pygame via apt. The upcoming version 0.11 should however solve all this issues. — Reply to this email directly, view it on GitHub <#178 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALVWMVAQC76IEKYNSJEEGLVCGY6XANCNFSM5EG2A3QA . You are receiving this because you were mentioned.Message ID: @.>

    While that is true for Debian-based distributions, other more "state-of-the-art" kind of distros (e.g. Arch) will most likely not have 1.9.6 available anymore.

    The problem also extends to Windows and MacOS. Under Windows, for example, Pygame versions < 2 are only available for Python <= 3.7. For a recent Python 3.10 there is only Pygame 2 available (at least on PyPi).

  13. chrplr commented on Mar 28, 2022

    @chrplr
    Contributor
  14. chrplr commented on May 14, 2022

    @chrplr
    Contributor

    I am not sure if pygame2 will "save the day". Contrary to what I wrote above, it does not seem to always rely on opengl, and even when it does, it does not necessarily work as expected. The following tests of blocking on displya flip work fine with the current version of expyriment, while, (on my computer at least) the pure pygame version (using pygam 2.1.2) does not block on vsync.

    tearing_tests.zip

  15. fladd commented on Jun 14, 2022

    @fladd
    Member

    Indeed, Pygame will not block on the vertical retrace. I think the idea there is merely to enable vsync (i.e. internally, the video card will only update when it is at the left top corner, so you shouldn't see tearing, but it will not block, i.e. the reported times are meaningless). It should be comparable to our current OpenGL mode 1, and we could think about changing this mode to not use OpenGL.

  16. fladd commented on Jun 14, 2022

    @fladd
    Member

    @lindemann09 Is the package libfreetype6-dev still needed under Debian with Pygame2?

  17. fladd commented on Aug 30, 2024

    @fladd
    Member

    I tested this on Anti Linux 23.1 (based on Debian 12), and it seems that this is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions