Holcombe:SubversionEtc: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 9: Line 9:


== Accessing your stand-alone psychopy modules from a terminal session ==
== Accessing your stand-alone psychopy modules from a terminal session ==
Psychopy IDE editor is annoying, I prefer to run IPython from terminal and edit in TextWrangler. Once in python, I execute this code to add the directories to my path.
Recall that sys.path which python uses might be affected by:  .profile file in home directory, PYTHONSTARTUP file if you have one. But what adds the default directories to sys.path ?
<code>
 
#'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PsychoPy-1.00.00-py2.5.egg'
Psychopy IDE editor is annoying, I prefer to run IPython from terminal and edit in TextWrangler. I don't know how to access the code in the PsychoPyIDE library, so instead I use svn to checkout a new version and then compile it
import os
  python setup.py install
psychopyStandAloneLibDir = '/Applications/PsychoPyIDE.app/Contents/Resources/lib/python2.5/'
 
os.listdir(psychopyStandAloneLibDir)
But noone's been able to access the PsychoPyIDE installation of python successfully from the terminal, see
for root,dirs,files in os.walk(psychopyStandAloneLibDir):
[http://groups.google.com/group/psychopy-users/browse_thread/thread/c1fb9c7fc23920f?hl=en discussion]
topleveldirs = dirs
 
break
 
for dir in topleveldirs:
>>> from psychopy import *
if (dir != 'config') and (dir != 'lib-dynload'): #assume all other directories are python packages
Traceback (most recent call last):
pathToAdd = psychopyStandAloneLibDir + dir +'/'
  File "<stdin>", line 1, in <module>
print pathToAdd
  File "/Applications/PsychoPyIDE.app/Contents/Resources/lib/python2.5/psychopy/misc.py", line 7, in <module>
sys.path.insert(0,pathToAdd) #add directory at beginning of path
    import monitors
</code>
  File "/Users/jwp/Code/psychopy/monitors/__init__.py", line 2, in <module>
  File "/Users/jwp/Code/psychopy/monitors/calibTools.py", line 13, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy-0.7.0.dev4645-py2.5-macosx-10.3-i386.egg/scipy/__init__.py", line 86, in <module>
ImportError: cannot import name Tester

Latest revision as of 16:52, 27 May 2009

Recent members

Alex Holcombe
• Ryo Nakayama



Technical

Skills Checklist
Python Programming
Psychopy/VisionEgg Installation Notes
R analysis,plot,stats
Statistics
Buttonbox
Buttonbox with photocell
Programming Cheat Sheets


Subversion

here at Sydney Uni we live behind a proxy server so subversion will not work unless you configure subversion for that https://www.opends.org/wiki/page/ConfiguringSubversionToUseAProxyServer

which tells you to edit ~/.subversion/servers to tell it about the proxy. If you don't have this file, first try typing just 'svn' in terminal to check if you have it, if so run ANY command on svn and the config file will be created. Then you can hopefully execute: svn checkout http://psychopy.googlecode.com/svn/trunk/ psychopy-read-only

Accessing your stand-alone psychopy modules from a terminal session

Recall that sys.path which python uses might be affected by: .profile file in home directory, PYTHONSTARTUP file if you have one. But what adds the default directories to sys.path ?

Psychopy IDE editor is annoying, I prefer to run IPython from terminal and edit in TextWrangler. I don't know how to access the code in the PsychoPyIDE library, so instead I use svn to checkout a new version and then compile it

 python setup.py install

But noone's been able to access the PsychoPyIDE installation of python successfully from the terminal, see discussion


>>> from psychopy import * Traceback (most recent call last):

 File "<stdin>", line 1, in <module>
 File "/Applications/PsychoPyIDE.app/Contents/Resources/lib/python2.5/psychopy/misc.py", line 7, in <module>
   import monitors
 File "/Users/jwp/Code/psychopy/monitors/__init__.py", line 2, in <module>
 File "/Users/jwp/Code/psychopy/monitors/calibTools.py", line 13, in <module>
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy-0.7.0.dev4645-py2.5-macosx-10.3-i386.egg/scipy/__init__.py", line 86, in <module>

ImportError: cannot import name Tester