| Reference | Downloads | Github

How do I get PsychoPy working in PyCharm on mac?


I feel very stupid but I can’t get PyCharm to run a PsychoPy script for anything, and every time I try to load the interpreter in PyCharm it throws a fit.

I know the correct interpreter (/Applications/, but anytime I try to do anything with it I get:

from psychopy import visual, event, core, data, gui, monitors, tools, sound File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/", line 43, in <module> from psychopy.preferences import prefs File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/preferences/", line 13, in <module> from . import preferences as prefsLib File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psychopy/preferences/", line 6, in <module> from builtins import object File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/builtins/", line 8, in <module> from future.builtins import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/future/builtins/", line 10, in <module> from future.builtins.iterators import (filter, map, zip) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/future/builtins/", line 38, in <module> from future import utils File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/future/utils/", line 54, in <module> import copy File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 52, in <module> import weakref File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 14, in <module> from _weakref import ( ImportError: cannot import name _remove_dead_weakref
This also occurs if I try to get it to “Install packaging tools”, which it wants to do when you select the thing.

I also can’t install PsychoPy as a package into its default python environment, which would seem to be the logical alternative. It gives me an error message about needing to run with sudo -H, which I can’t do from PyCharm. PyCharm’s documentation is also grossly inadequate.

@jon I know you use PyCharm, what am I missing?


I use pycharm with a standard python install. When I use standalone PsychoPy I just use the Coder.
There’s something about the packaging of the python inside the app that means it doesn’t like being launched like a regular python. It knows that it has been “frozen” somehow


As Jon mentioned, the download from the PsychoPy website will be difficult to get working with Pycharm. Instead, create a virtual environment, and use pip to download PsychoPy and run your script in Pycharm with that environment.


FWIW I use PyCharm and Psychopy with Anaconda Python and that also works well.

I tried to get the /Applications/ version to work with Pycharm, figuring that maybe I could make the interpreter happy by setting its environment variables from PyCharm before launching the Python interpreter, but finally gave up after dorking with that for a while and failing to make it work. The availability of working alternatives discourages significant expenditure of effort on that.



Thanks all. I tried getting PsychoPy using PyCharm’s package installer and it got it, and when I hit run it launches a python something but doesn’t actually successfully load a window or anything. That doesn’t seem to be an issue of it missing psychopy, just something about the whole python setup. For now, I have a workflow that is adequate (edit in PyCharm, test in PsychoPy).


This would be fixed by a rethink of how we package/deliver the Standalone. I’m thinking about re-working that to be a network-install script rather than providing all the packages in a single download: