Cython Error with installation of psychopy package on Mac Silicon

50 Views Asked by At

I am attempting to use the psychopy package (version 2023.2.3), and it appears to install some psychtoolbox files alongside itself. On running import psychtoolbox as ptb with Mac Silicon, I get:

ImportError                               Traceback (most recent call last)
Cell In[57], [line 1](vscode-notebook-cell:?execution_count=57&line=1)
----> [1](vscode-notebook-cell:?execution_count=57&line=1) import psychtoolbox as ptb

File [~/miniforge3/envs/goodfeeling/lib/python3.10/site-packages/psychtoolbox/__init__.py:28](https://file+.vscode-resource.vscode-cdn.net/Users/davidcsuka/Documents/nanoGPT/~/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py:28)
     [26](file:///Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py?line=25) from .WaitSecs import WaitSecs
     [27](file:///Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py?line=26) from .GetSecs import GetSecs
---> [28](file:///Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py?line=27) from .PsychHID import PsychHID
     [29](file:///Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py?line=28) from .IOPort import IOPort
     [30](file:///Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/__init__.py?line=29) if is_64bits:

ImportError: dlopen(/Users/davidcsuka/miniforge3/envs/myenv/lib/python3.10/site-packages/psychtoolbox/PsychHID.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_AllocateHIDObjectFromIOHIDDeviceRef'

The same thing happens with python 3.9, and with Python 3.8 (recommended) the psychopy installation doesn't even work in pip due to:

File "/private/var/folders/9x/x950xm6j3ws6cm5rcv8w34kh0000gn/T/pip-build-env-a0oj0w5k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/9x/x950xm6j3ws6cm5rcv8w34kh0000gn/T/pip-build-env-a0oj0w5k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 928, in <module>
        File "<string>", line 923, in get_cython_extfiles
        File "/private/var/folders/9x/x950xm6j3ws6cm5rcv8w34kh0000gn/T/pip-build-env-a0oj0w5k/overlay/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/9x/x950xm6j3ws6cm5rcv8w34kh0000gn/T/pip-build-env-a0oj0w5k/overlay/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx
      [end of output]

Do I perhaps need to use some different version of Cython, or are various C compilers incompatible with each other? Or maybe this pertains to my operating system?

0

There are 0 best solutions below