| Reference | Downloads | Github

Help installing moduals pytables from preferences

I want to use iohub, but I am very frustrated. I have been trying (for weeks) to install 2 libraries with preferences (pytables, pyYAML). Your documentation gives this example: [‘/Users/jwp/code’, ‘~/code/thirdParty’]

I downloaded the 2 libraries and put them in a folder (PsychoPyLibraries) next to at the top level and put in PsychoPy preferences:
What do I put for the xxxx? The folder pytables has lots of folders and code.

I’ve tried a dozen guesses like, etc. I have no idea. Same question for pyYAML.

I want to use a tobii eye tracker. I put in the code from Chapter 19 of the PsychoPY book, but the first thing I get is:

WARNING: pytables package not found. ioHub functionality will be disabled.

I was hoping that 3.0.7 would have the required modules, but it doesn’t.

Now for my very stupid question. Maybe you should skip the following question, or just direct me to some more elementary site. I am on Mac (10.14) & your documentation says to use iohub it says I also need pyobjc. I have installed X-Code because I used to code in Objective C. So maybe its there? But since I really don’t know, I followed a bunch of instructions starting from a link in PsychPy documentation software requirements for iohub. I may have installed pyobjc but not sure.

First, I think I installed pip following some youtube instructions. I got on the terminal:
Installing collected packages: pip, wheel
Successfully installed pip-19.0.3 wheel-0.33.1

Then I tried to install pyobj, and the best I got was:
Found existing installation: pyobjc-core 2.5.1
Uninstalling pyobjc-core-2.5.1:
followed by pages and pages of red ink. I guess I have pyobj?

I think maybe just tell me how to install pytables and pyYAML and I’ll move from there. If I move ahead only one error message I will be grateful.

Bill Prinzmetal

pytables and yaml should both be there (see below) so we need to work out what’s wrong with the error message. It might be an issue with iohub itself (e.g. not being Py3 compatible) and @sol has been back on the job lately to fix that side of things. Was there anything else in the warning message that might help us?

In a way that is good. Here is the error message in its entirety:

PyShell in PsychoPy - type some commands!

Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
import tables
Traceback (most recent call last):
File “”, line 1, in
File “/Applications/”, line 90, in
ImportError: dlopen(/Applications/, 2): Library not loaded: @loader_path/libsz.2.dylib
Referenced from: /Applications/
Reason: image not found

I may have done something that messed up PsychoPy in my many attempts to make it work. So when 3.0.7 came out I, I put 3.0.6 PsychoPy3 in the trash and installed a new version (just a few days ago). I had 2 friends try the “import tables” on their macs and they got the same message (but that was before 3.0.7). Also PsychoPy takes a long time to start up. If I reinstall the standalone version are there some helper files I need to remove (preference, application support). Maybe I have to install the OSX again?

I’m going to attach the experiment, not asking you to debug it, but maybe there is information there. I will also attach the YAML file I used in case that messed something up. (I’ll change the .yaml to .cvs
so it will not be rejected.) Again I don’t expect you to debug that, but I want to give you all the info. (The YAML file differs from the for Tobii eyetracker referred to in book because I got the message "KeyError: “ioHubConfig must be provided with ‘monitor_devices’ key:value.” so I added a monitor devices section. (I do not think either of these could have caused the bug). I think in my may attempts to make 3.0.6 work, I did some damage to some helper file.

I think I must have messed up something when I tried to get tables and pyYAML to work with 3.0.6

Sorry to put you to so much work.

eyeTracker1.psyexp (15.8 KB)

iohub_config3.csv (1.7 KB)

Oh, one more thing, now with 3.0.7 “import yaml” causes NO error now (it did in 3.0.6). So its definitely something I did to psychoPy. I think I need to clean out all traces of PsychoPy and reinstall it?

I think that would be a good idea. Once you have a clean install of the latest macOS build please let us know how it goes. Thanks.

I searched out anything that had ‘psychoPy’ in it and trashed it. Empty trash, restarted computer, and installed a clean version of PsychoPy3.0.7. Got the same error:

import tables
Traceback (most recent call last):
File “”, line 1, in
File “/Applications/”, line 90, in
ImportError: dlopen(/Applications/, 2): Library not loaded: @loader_path/libsz.2.dylib
Referenced from: /Applications/
Reason: image not found

I am not sure what to do now. I tried some of the (coder) iohub demo and got the same error message: pytables could not be found. I could reinstall OSX10.14.3, but that seems an unlikely fix. But I will try. Maybe my hd is screwed up somehow. Maybe I’ll try something like disk first aid or techtool pro or …?

I do not think you should need to reinstall your operating system. @jon could this be an issue specific to macOS 10.14.3? The error seems to indicate that a lib called libsz.2.dylib could not be found.

@Bill_Prinzmetal, do you have access to an earlier version of macOS you could try on?

I just noticed the above. Whether iohub Tobii will work or not on macOS and Python 3 is also an unknown to me that you may also run into issues with. Just setting expectation, happy to try and help work through it with you when you get to that point.


I tested StandalonePsychoPy3-3.0.7-MacOS.dmg on macOS 10.13.6 and both pytables and yaml import from the PsychoPy Shell:

PyShell in PsychoPy - type some commands!

Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import tables
import yaml

@Bill_Prinzmetal, could you test on a macOS version prior to 10.14 if you have access to one? I only have access to 10.9.5 and 10.13.6 right now so can not test myself if this is an issue specific to 10.14.

Sol (Jon and others)
Thank you for hanging in this problem. I absolutely know tables is in 3.0.7 because when I examine package contents, I see it. Nevertheless, when I type:

import tables
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/", line 90, in <module>
ImportError: dlopen(/Applications/, 2): Library not loaded: @loader_path/libsz.2.dylib
  Referenced from: /Applications/
  Reason: image not found

import yaml, import other modules work fine.
if I follow the path /Applications/PsychoPy3/…/ and look at line 90 it says:

from .utilsextension import (
    get_pytables_version, get_hdf5_version, blosc_compressor_list,
    blosc_compcode_to_compname_ as blosc_compcode_to_compname,
    blosc_get_complib_info_ as blosc_get_complib_info)

If I follow the path:
Its there too.

This means nothing to me but some path is wrong. When I was messing around trying to put a path in preferences (with PsychPy 3.0.6) I probably messed up some helper file, some path file, but I do not know what. I cleaned out every file that I could find that has psychPy in its name (except my programs and data), I have uninstalled and reinstalled PsychPy3.0.7 many times.

I also reinstalled the system — you were correct, that didn’t help. Just in desperation I reinstalled Xcode. Restarted the computer and that didn’t help.

The only hit I have is that PsychPy starts very very slowly.

I searched through every file with the ext .pth, and the last one that was modified was May last year, and none of them had anything to do with PsychoPy.

I tried to follow the instructions for installing pyobjc which required typing some commands in the terminal and downloading and installing pip from the terminal. I bet I did something stupid there. But if reinstalling the system didn’t fix it, then what?

Thanks for trying. Any ideas I would be happy to try.

Bill Prinzmetal

I’m not sure that it can be an OS version thing: although I see the same error as Bill when I import tables in standalone PsychoPy (v3.0.2), I don’t get an error when doing the same in my development installation (although that is PsychoPy v 3.0.6). All done under Mac OS 10.14.4

My development Mac is 10.14.3 so it isn’t the version of that that’s the issue.

It looks like an issue with a non-existent ‘libsz.2.dylib’ library. We aren’t packaging that right now as there was previously an issue with it failing to package properly but on my own machine it shows up at /usr/local/lib/libsz.2.dylib. My very strong hunch is that that’s the difference. It looks as though I installed that at some point using

brew install szip

(you’ll need to install homebrew first if you haven’t got that already).

But I will also work out the right fix for this in the build process

That would also explain why it works for me - I’ve previously installed all the psychopy dependencies separately for a dev. env. as well, and the standalone must be picking up something from that.

Jon, Thanks you for all your efforts. I tried to install homebrew. It seemed simple,“type the following command into terminal:”

/usr/bin/ruby -e "$(curl -fsSL"

but got “Illegal variable”.

I’ve really screwed up my psychoPy. Last night I thought I would clean out everything related to PsychoPy (except my experiments and data). I found a old 2.?,? got rid of that and anything with psychoPy and also the .psych3 file. Downloaded a fresh copy of PsychoPy3.0.7. Now I screwed things up so it takes a full minute to start psychopy. Then when I go to open a x.psyexp that will take a minute. (and my computer will be locked while that happens.) So I’ve done some serious damage to my psychoPy or file structure or something. I better stop and wait and get psychoPy just normal again.

The strange thing is if I open package contents of PsychoPy3.0.7 and look at Contents/Resources/lib/python3.6/tables/.dylib/ I see libhdf5.10.dylib, its 4.4 mb.

I do not know how I’ve screwed up psychoPy, or when it can’t see the file libdf.5.10.dylb.

Thank you. I’m going to stop for a while. I managed to make my PsychoPy freeze for a minute whenever I try file operation. When a program starts to run it runs fine but I messed up something.

I tried to install Homebrew but couldn’t get it to work. I think I better stop messing around with my computer at that level. I’ve uninstalled and installed Standalone 3.0.7 that at some point I did some real damage. It not takes PsychoPy a minute to start up and a minute to open any .psyexp. I think I better not mess around anymore.
I had my friend install Standalone 3.0.7 (OSX 10.14.4) and he gets the same error message when typing to the shell import tables.*
I think that I will have to wait until 3.0.8. I want to see if I can get a Tobii eye tracker to work. I have put in and checked the code in Chapter 19. Studied the YAML file structure (I think the Tobii example needs a ‘monitor_devices:’ but you have done a great job of documenting the .yaml examples that I think I can figure that out.
*To the shell import the other libraries psutil,msgpack,greenlet,gevent,numexpr,yaml all work without error. The code line in chapter 19:
from psychopy.iohub import util, client
returns ofcourse pytables package not found. iohub … will be disabled.