Search code examples
pythonpython-2.732bit-64bitanacondapsychopy

Anaconda environments for 32bit and 64bit parallel?


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.


Solution

  • 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 ...