Giter Site home page Giter Site logo

psychopy-on-m1's Introduction

Installing PsychoPy on Apple Silicon Macs

PsychoPy runs currently on Apple Silicon Macs through Rosetta 2. I've created instructions to install PsychoPy from source so that it runs natively on Apple Silicon.

Installation instructions for latest version of PsychoPy (2023.2.3)

Latest version works natively on Apple Silicon Macs. However, vsync is not working properly on macOS Ventura/Sonoma. VSync works fine on macOS Monterey. There are also some other issues (e.g. Microphone and Eyetracker components are not yet working).

psychopy-on-m1's People

Contributors

waltervanheuven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

psychopy-on-m1's Issues

failed to install tables

Well, I failed to install psychopy on m1. There are some errors and confusion during the process.

  1. I failed to install tables whe use pip install tables the error as following:
  Using cached tables-3.8.0.tar.gz (8.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [61 lines of output]
      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      ld: library not found for -llzo2
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ld: library not found for -llzo
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      
      def _dump_h5_backtrace():
          cdef object bt = []
      
          if H5Ewalk(H5E_DEFAULT, H5E_WALK_DOWNWARD, e_walk_cb, <void*>bt) < 0:
                                                     ^
      ------------------------------------------------------------
      
      tables/utilsextension.pyx:384:47: Cannot assign type 'herr_t (unsigned int, const H5E_error_t *, void *) except? -1 nogil' to 'H5E_walk_t'
      cpuinfo failed, assuming no CPU features: 'flags'
      * Using Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:25:14)
      * Found cython 3.0.0
      * USE_PKGCONFIG: True
      * Found conda env: ``/Users/tongzhao/miniconda3``
      * Found HDF5 headers at ``/opt/homebrew/opt/hdf5/include``, library at ``/opt/homebrew/opt/hdf5/lib``.
      .. WARNING:: Could not find the HDF5 runtime.
         The HDF5 shared library was *not* found in the default library
         paths. In case of runtime problems, please remember to install it.
      * Could not find LZO 2 headers and library; disabling support for it.
      * Could not find LZO 1 headers and library; disabling support for it.
      * Found bzip2 headers at ``/opt/homebrew/opt/bzip2/include``, library at ``/opt/homebrew/opt/bzip2/lib``.
      * pkg-config header dirs for blosc: /opt/homebrew/Cellar/c-blosc/1.21.4/include
      * pkg-config library dirs for blosc: /opt/homebrew/Cellar/c-blosc/1.21.4/lib
      * Found blosc headers at ``/opt/homebrew/Cellar/c-blosc/1.21.4/include``, library at ``/opt/homebrew/Cellar/c-blosc/1.21.4/lib``.
      .. WARNING:: Could not find the blosc runtime.
         The blosc shared library was *not* found in the default library
         paths. In case of runtime problems, please remember to install it.
      * Found blosc2 headers at ``/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/include``, library at ``/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib``.
        * Copying blosc2 runtime library to 'tables' dir because it was not found in standard locations
      Compiling tables/utilsextension.pyx because it changed.
      [1/1] Cythonizing tables/utilsextension.pyx
      Traceback (most recent call last):
        File "/Users/tongzhao/Documents/Psychopy/psychopy-on-M1/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/tongzhao/Documents/Psychopy/psychopy-on-M1/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/tongzhao/Documents/Psychopy/psychopy-on-M1/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 928, in <module>
        File "<string>", line 923, in get_cython_extfiles
        File "/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/b9/smm3d4xj4y778d4gpcc3xvjc0000gn/T/pip-build-env-n4a_qy9x/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I guess there might need some skills to install tables.

  1. some confuse about step 7
    as the instroduction said, i need to cd tmp to install Psychtoolbox. Do you mean that I need to go into the tmp folder under the root directory of the computer? In other words, is it /tmp?

BTW, the installation of Psychtoolbox also failed. I don't know if it's because of an error in the tables installation.

  1. some mistake in step 11
    after modify setup.cfg, we should also modify the setup.py as replacing pyqt5 with pyqt6. another issue also mentioned this problem.

setup.py

I had to edit line 41 in setup.py:

    required.remove('pyqt5')

to

    required.remove('pyqt6')

unable to install pyo

Hi there,

Thanks so much for showing how to install native PsychoPy on M1 Macs. I followed the instruction but had an error when I tried to install pyo with pip.

The error message showed include/servermodule.h:31:10: fatal error: 'sndfile.h' file not found

Could you look into this issue and let me know how to address it?

Thanks,
Gabriel

Trouble in installing psychopy

Thanks for making this tutorial, however I still receive errors install these packages: pocketsphinx, psychtoolbox, pyo, grpcio

clang error: no such file or directory: 'PsychSourceGL/Cohorts/PortAudio/libportaudio_osx_64.a'

Hi, I tried to follow your instructions, but I got this:

#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
2 warnings generated.
clang: error: no such file or directory: 'PsychSourceGL/Cohorts/PortAudio/libportaudio_osx_64.a'
error: Setup script exited with error: command '/usr/bin/clang' failed with exit code 1

I didn't completely follow your instructions, thought. I'm using Python 3.9 installed with Mamba. Would you expect that that has something to do with it?

Failed to import psychToolbox

Hey, it's me again :) I have two questions want to ask.

  1. How to start Psychopy after exit Psychopy?
    I followed your step and run psychopy successfully. But how could start it again? My way is run psychopy in /venv/bin/psychopy, is this correct way?

  2. I failed to run any psyexp file. The error info is

1.0450     WARNING     The 'psychtoolbox' library cannot be loaded but is required for audio capture (use `pip install psychtoolbox` to get it). Microphone recording will be unavailable this session. Note that opening a microphone stream will raise an error.
Traceback (most recent call last):
1.0472     ERROR     Failed to load any of the audioLibs: ['ptb']. Falling back to PsychToolbox ('ptb') backend for sound. Be sure to add 'ptb' to preferences to avoid seeing this message again.
1.0493     ERROR     No audioLib could be loaded. Tried: ['ptb']
 Check whether the necessary audioLibs are installed
  File "/Users/tongzhao/Documents/untitled_lastrun.py", line 21, in <module>
    from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout
  File "/Users/tongzhao/Documents/Psychopy/psychopy-on-M1/venv/lib/python3.10/site-packages/psychopy/sound/__init__.py", line 214, in <module>
    if audioLib.lower() != 'ptb':
AttributeError: 'NoneType' object has no attribute 'lower'
################ Experiment ended with exit code 1 [pid:97485] #################
73.9589     INFO     Loaded monitor calibration from ['2023_07_25 11:09']

The trial doesn't include any audio stimulation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.