Psych711-PC

From Lupyan Lab
Jump to: navigation, search

Installation instructions for PCs


Contents

Remove old python installations

Step zero: If needed: uninstall any versions of python that you have personally installed. This includes standalone PsychoPy. Don't touch your system version. Note: if you don't know what this means, just ignore it.

Install Python and Psychopy with its necessary libraries

Python Installation and Configuration

You will need to install Python and Psychopy, which is the experiment-building library we will be using. In this class we will use the Enthought Platform which includes Python 2.7 and all the libraries required by Psychopy.

C:\>setx path "%PATH%;C:\users\(your user name here)\appdata\local\enthought\canopy32\app\python27" at the prompt. After pressing Enter you should be informed that the command was successful. Try typing python at the prompt again to make sure it's now working.

Psychopy Installation

To install Psychopy you will need to download the library and run its setup script.

Install Cygwin

Install Notepad++

One plugin I recommend is autosave which will automatically save unnamed text files. To install plugins (a simple matter), please follow the instructions at the top of this page
When you install the autosave plugin and start Notepad++ you may get a dialogue box with the message
"This ANSI plugin is note compatible with your Unicode Notepad++.. Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?"
You can click yes to delete the plugin. Autosave will continue to work. Autosave installs two versions of itself (one works, the other doesn't). You're merely deleting the non-working version.


Install ImageMagick

Tweak the working environment and test a couple things

First, if you're not sure whether you have 32 or 64 bit windows, type this at the prompt:

wmic os get osarchitecture

Aliases for Cygwin (Windows 32-bit)

If you're using a 32-bit version of windows use this set of instructions.

Let's now add a couple 'aliases' to help you navigate in cygwin.

cd ~
echo alias e=\""run.exe /cygdrive/c/Program\ Files/Notepad++/notepad++.exe\"" >> .bashrc
echo alias psych711=\""cd /cygdrive/c/Users/$USER/Box\ Sync/Psych711_*/"\" >> .bashrc
alias ls='ls -h --color'
source .bashrc

Aliases for Cygwin (Windows 7 64-bit)

If you're using Windows 7 64-bit use the instructions below.

cd ~
echo alias e="\"run.exe /cygdrive/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe"\" >> .bashrc
echo alias psych711=\""cd /cygdrive/c/Users/$USER/Box\ Sync/Psych711_*/"\" >> .bashrc
alias ls='ls -h --color'
source .bashrc

Test Python within Cygwin

e ~/.bashrc

This will open up the .bashrc file which contains your cygwin user settings, in Notepad++

You'll want to copy/paste the code below into the bottom of the file.

pythonF() {
	if [ "$#" -gt 0 ]; then
		python $1
	else
	python -i 
	fi
}
alias python=pythonF

Now, save the file, go back to the cygwin prompt and type source ~/.bashrc Try typing in python again, and this time it should take you to the prompt.

Test aliases and psychopy

psych711
python test.py

You should see something trippy. If you're not in the class and so don't have a class Box account, you won't have a test.py file and so won't see anything trippy. Sorry :/ You can test that your psychopy installation is working like so:

$> python
Enthought Canopy Python 2.7.3 | 32-bit | (default, Mar 25 2013, 15:42:04) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import psychopy
>>> psychopy.__version__
'1.84.1'
exit()


Check if ImageMagick installed properly.

In a cygwin window type:

convert logo: logo.gif
imdisplay logo.gif

If that opened up an image, you're good to go.

Personal tools
Namespaces
Variants
Actions
Navigation
Download and Install
Notes for each class - will be updated ~week before each class.
Programming Exercises
Projects
Quick reference
Toolbox