Changes

Jump to navigation Jump to search
no edit summary
Line 38: Line 38:     
==Installation==
 
==Installation==
We recommend to use a modern 64-bit version of Python. In our labs, we currently have Python 3.7.6 64 bits installed. You can download it here: [https://www.python.org/ftp/python/3.7.6/python-3.7.6-amd64-webinstall.exe Python3.7.6 64 bits (Windows)] or choose here: [https://www.python.org/downloads/release/python-376/ Please choose a 64 bit version.]. Run the installer and make sure to add Python to the file path (it's an option in the installer).
+
We recommend to use a modern 64-bit version of Python. In our labs, we currently have Python 3.8.10 64 bits installed. Psychopy recommends Python 3.8.10.
   −
Download from here: [https://gitlab.socsci.ru.nl/h.voogd/psychopy-installation-on-python-3.7-64-bits PsychopyRequirements3.7.txt].Open a command prompt (with administrator rights), go to the folder where the downloaded file is and upgrade the pip installer by typing:<br/>
+
Check our gitlab server https://gitlab.socsci.ru.nl
<code style="background-color:#000; color:#fff; padding:1px 3px;">python -m pip install --upgrade pip</code><br/>
  −
Then:<br/>
  −
<code style="background-color:#000; color:#fff; padding:1px 3px;">pip install -r PsychopyRequirements3.7.txt</code>
  −
 
  −
This should install everything you need for a basic Psychopy installation. Since packages are updated once in a while, this PsychoPyDependenciesPython3.7.txt might get outdated at some time. Please let us know.
      
=== For Pavlovia users ===
 
=== For Pavlovia users ===
Line 51: Line 46:  
''System| Advanced system settings | Environment variables'', add the folder where ''git-daemon.exe'' is, to the PATH variable. Usually, that folder is named: 'C:\Program Files\Git\mingw64\libexec\git-core'.
 
''System| Advanced system settings | Environment variables'', add the folder where ''git-daemon.exe'' is, to the PATH variable. Usually, that folder is named: 'C:\Program Files\Git\mingw64\libexec\git-core'.
   −
===Upgrade from Python 2.7===
+
===Lab computer versioning===
Since Python version 2.7 has reached end of life since January first 2020, this version is no longer installed on the PCs in the labs. Standard is now: Python 3.7 64-bits.
+
 
If you still have scripts written in Python2, the scripts should be upgraded to Python 3. Most changes are probably the print statements. Print statements should always have parentheses: print('some text')
+
 
Key differences between Python 2 and Python 3 are here: https://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html
+
A default version of Psychopy has been installed in the root of the Python3.8.10 64-bit version. This is also the default version when 'psychopy' is typed from the command prompt. It is also the default that opens when a .py file is double-clicked. It also can be started by clicking the appropriate icon on the desktop. One in a while, the default version is upgraded to a newer version. The older version is then still available in a virtualenv.
   −
Psychopy 2020.2.10 has been installed in the root of the Python3.7 64-bit version. This is also the default version when 'psychopy' is typed from the command prompt. It is also the default that opens when a .py file is double-clicked. It also can be started by clicking the appropriate icon on the desktop.
  −
There is also a Psychopy 2020.2.10 installed on Python3.6 32-bits. This version has its own icon on the desktop and should be used when you are using a TOBII Eyetracker.
   
   
 
   
 
When your script fails to load in Psychopy, because you need packages that are not installed on our labcomputers, please contact TSG.
 
When your script fails to load in Psychopy, because you need packages that are not installed on our labcomputers, please contact TSG.
    
On the labcomputer, there is support for Spyder, PyCharm and Psychopy.  
 
On the labcomputer, there is support for Spyder, PyCharm and Psychopy.  
  −
=== For Tobii users ===
  −
Since Tobii does not support 64-bits and does not support Python higher than version 3.6.8, there is a 32 bits Python version 3.6.8 installed. If you want to use a Tobii Eyetracker and want to install Python and Psychopy yourself, download Python here: [https://www.python.org/ftp/python/3.6.8/python-3.6.8-webinstall.exe Python3.6.8 (Windows)] or here: [https://www.python.org/downloads/release/python-368/ List of downloads for Python3.6.8. Please choose a 32-bit version.] Run the installer, choose to add python to the file path (it's an option in the installer).
  −
  −
Download from here: [https://gitlab.socsci.ru.nl/h.voogd/psychopy-installation-on-python-3.6.8 PsychoPyDependenciesPython3.6.8.txt]. Open a command prompt (with administrator rights), go to the folder where the downloaded file is and upgrade the pip installer by typing:<br/>
  −
<code style="background-color:#000; color:#fff; padding:1px 4px;">python -m pip install --upgrade pip</code><br/>
  −
Then:<br/>
  −
<code style="background-color:#000; color:#fff; padding:1px 4px;">pip install -r PsychopyRequirements3.6.8.txt</code>
  −
  −
'''Note:''' in our labs, the 64-bits Python and 64-bits Psychopy are installed as default. The 32-bits Python 3.6.8 and 32-bits Psychopy are installed in a separate ''virtualenv''. If you want to use Python3.6.8 from the command prompt, you first have to type:<br/>
  −
<code style="background-color:#000; color:#fff; padding:1px 4px;">workon Python36</code><br/>
  −
After that, everything should work from Python3.6.8, including the 32-bits packages.
      
=== For SR-Research Eyelink users ===
 
=== For SR-Research Eyelink users ===
Eyelink users should follow the regular instructions above. Additionally, download the SR-Research Python package from here: [https://gitlab.socsci.ru.nl/h.voogd/PyLink3.7-64bit pylinkForPython-3.7.5-x64-Win]. Unzip it, find the folder called: '''pylink''' and copy it to your Pythons '''lib/site-packages''' folder.
+
Eyelink users should follow the regular instructions above. Additionally, in the installer folder from our Gitlab, find the pylink version you need, rename it to '''pylink''' and copy it to your Pythons '''lib/site-packages''' folder.
    
=== For SMI RED 500 and SMI HiSpeed Tower users ===
 
=== For SMI RED 500 and SMI HiSpeed Tower users ===
Line 98: Line 79:  
'''deactivate''' to return to the defaults.
 
'''deactivate''' to return to the defaults.
 
<br>
 
<br>
In our labs, we have th evirtualenvs:<br>
  −
'''Python36''' that contains Python 3.6.8 32-bits, Psychopy and the tobii_research package.<br>
  −
'''Python37''' that contains Python 3.7 64-bits, Psychopy and the pylink package (for use with the Eyelink eyetracker).<br>
  −
and some more virtualenvs that contain packages that would otherwise interfere with Psychopy.
      
If you need a package that is not installed on our labcomputer, contact TSG, so that we can decide to add it to our standard installation, or to install it in a separate virtualenv. Do '''not''' use ''pip install'' and install anything in an existing virtualenv. Unless it is your own virtualenv. This might interfere with existing packages and might mess up other peoples projects. Instead, make your own virtualenv and install it there (use '''mkvirtualenv''' to create it, use '''workon''' to activate it, then use '''pip''' to install packages into your own virtualenv). Also, make a backup of your virtualenv, since when the labimage is updated, the newly created virtualenvs will be gone.
 
If you need a package that is not installed on our labcomputer, contact TSG, so that we can decide to add it to our standard installation, or to install it in a separate virtualenv. Do '''not''' use ''pip install'' and install anything in an existing virtualenv. Unless it is your own virtualenv. This might interfere with existing packages and might mess up other peoples projects. Instead, make your own virtualenv and install it there (use '''mkvirtualenv''' to create it, use '''workon''' to activate it, then use '''pip''' to install packages into your own virtualenv). Also, make a backup of your virtualenv, since when the labimage is updated, the newly created virtualenvs will be gone.
    
=== Spyder ===
 
=== Spyder ===
Spyder (Scientific Python Development Environment) is an IDE for Python. It can be run from a command prompt. If you want to use Spyder in the default Python 3.7.6 64-bits environment, you can just type '''Spyder''' from the command prompt. If you want to use Spyder from the Python36 virtualenv, type '''workon python36''' and then type '''Spyder3'''. If you have created your own virtualenv, make sure that Spyder is installed.
+
Spyder (Scientific Python Development Environment) is an IDE for Python. It can be run from a command prompt. If you want to use Spyder in the default Python environment, you can just type '''Spyder''' from the command prompt. If you want to use Spyder from a virtualenv, type '''workon <name of the virtualenv>''' and then type '''Spyder3'''. If you have created your own virtualenv, make sure that Spyder is installed.
    
=== PyCharm ===
 
=== PyCharm ===
Line 117: Line 94:  
'''python <myscript.py>'''<br><br>
 
'''python <myscript.py>'''<br><br>
 
Save the file into the folder where your script is, but change the extension from ''.txt'' to ''.bat'', for example, save the file as ''startmyscript.bat''.
 
Save the file into the folder where your script is, but change the extension from ''.txt'' to ''.bat'', for example, save the file as ''startmyscript.bat''.
  −
=== 32-bits Psychopy (Tobii users) ===
  −
Our labcomputer has a special virtualenv that is called '''Python36'''. This virtualenv contains everything that Psychopy needs to install, and it contains the '''tobii-research''' package. It also contains the packages that are needed to use the '''cv.dll''' library. <br>
  −
To start your script you can: <br>
  −
- start Psychopy using the icon on the desktop that uses the 32-bit version. <br>
  −
- from a command window, type '''workon Python36''', then type '''Psychopy''' to start the 32 bit Psychopy version.<br>
  −
- from a command window, type '''workon Python36''', then type '''Spyder3''' to start the Spyder IDE.<br>
  −
- choose the ''Python 3.6 (Python36)'' python interpreter in PyCharm. <br>
  −
- from a command window type '''workon Python36''', then type '''python <myscript.py>''' to start your script. Or make a batch file that does this.
 

Navigation menu