Reputation: 2151
I recently started using psychopy and want to use it without the standalone version but rather import it as a library.
I am using the Anaconda distribution and have already managed to install a new environment following the instructions given here
The problem is that a dependency (pyglet) does not seem to work on an mac OSX (10.11.3) with 64-bit python:
Exception: pyglet is not compatible with 64-bit Python for versions of Mac OS X prior to 10.6.
On the psychopy webpage it also says, that 32bit python is recommended. I however used the Anaconda3 64bit downloader before I knew I would be needing the 32bit version in the future. Now my question is: Can I set up a new environment that uses 32bit and run that in parallel to my 64bit environments? If yes, how?
If no, do I have to delete my Anaconda and get the 32bit version? What would be possible alternatives?
A similar question has been posted here
Thank you all! S.
Upvotes: 3
Views: 1481
Reputation: 2151
After searching through the Internet for the rest of the day, I found a solution that works for me. Hopefully this will help other people as well:
According to this forum post the problem with pyglet
does not lie in the 64bit but rather in a broken version check of mac OSX. Remember, the exception was:
Exception: pyglet is not compatible with 64-bit Python for versions of Mac OS X prior to 10.6.
... so python
and pyglet
somehow thought I wanted to run the script on a Mac OSX <10.
Anaconda-based Solution (if you followed this initial installation):
Within the terminal:
source activate psychopyenv # move to your anaconda psychopy environment
conda remove --name psychopyenv pyglet1.2 # delete the current version of pyglet
conda install -c jcarlin pyglet # install pyglet 1.2.4 from a different channel
Afterwards, I was able to run my psychopy
scripts in the spyder
editor. One strange thing remains: I have to restart the IPython kernel after running the script. Well ... that's for another day to solve.
UPDATE 03.03.2016:
including core.quit()
at the end of the script is the key if you do not want to restart the IPython kernel after running a script. Should have noticed earlier ...
Upvotes: 4
Reputation: 1223
The docs about incompatibility with 64bit python are a bit out of date. Pyglet 1.2 introduced Mac 64bit support. So most of the Mac PsychoPy dependencies have been compatible with that 64bit python for a while now (PsychoPy itself has always been).
For Conda how did you perform the install? There's a thread here where one contribute (Eric) created a conda install package using 64bit python and shows how to use it: https://groups.google.com/forum/#!topic/psychopy-dev/ndOWoiEwDMU
For iPython the problem is probably a clash between pyglet and ipython both trying to act as the 'application' and create the event loop. I don't know how that works but, basically, I wouldn't run any script "for real" using ipython because you don't know what additional overhead it adds in the background.
By the way, these sorts of questions might be better posed on the PsychoPy mailing list, rather than Stack Overflow. S.O. is more about programming tips than about software installation
cheers Jon
Upvotes: 1