> sw_vers
ProductName: Mac OS X
ProductVersion: 10.8.5
Standalone版インストール
> brew install --force Caskroom/cask/psychopy
その後、/opt/homebrew-cask/Caskroom/psychopy/1.82.00/PsychoPy2.app を直接起動するか、applicationにコピーすればOK
Standalone付属のpyshellではなく、自分のpythonから叩きたい場合は、
Prerequisites をすべてインストールする。Pythonについては64bit版でも問題なかったです。
http://www.psychopy.org/installation.html#dependencies
e.g.
pip install pyglet
pip install Image
brew install python liblo libsndfile portaudio portmidi --universal
brew install wxpython
すべてのPrerequisiteが揃ったら、
pip install psychopy
で完了。
適当に、以下の様なテストが動けばOK(importが正常に働くかどうか、足りないmoduleのあぶり出しが目的)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from psychopy import gui
from psychopy import visual, core, data, event, logging, sound
from psychopy.constants import *
import numpy as np
from numpy import sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray
from numpy.random import random, randint, normal, shuffle
import os
myWin = visual.Window(units='norm')
msg = visual.TextStim(myWin, text='test text', pos=(0,0))
counter = visual.TextStim(myWin, text='####', pos=(0,-0.5))
trialClock = core.Clock()
t=0
while t < 5.0:
t=trialClock.getTime()
counter.setText('%.2f' %(t))
msg.draw()
counter.draw()
myWin.flip()
最終更新:2015年12月10日 05:47