简体   繁体   中英

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.

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

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. SO is more about programming tips than about software installation

cheers Jon

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM