Pip install dependencies and Py3

Hi folks,

Two things to alert you on:

  1. the github repository master is now largely Py3 compliant (I’m sure there are bugs but most stuff works). It also uses wxPython 4.0 (a complete rewrite from wxPython team)
  2. nearly all dependencies should install automatically using pip install!

Both these aspects need testing. If you felt like trying to use Python3 from now on as your dev environment that would be cool!

In theory, just

  • install Python 3.6
  • go to your local copy of github repos (and pull the latest from remote)
  • do pip3 install -e . to get a development installation of the current code (that means it will be a link from site-packages to this folder, not copying the folder itself)
  • all dependencies except for pyo should install for you!

You’ll obviously need to check how your paths are set up etc. but you should then be able to launch the psychopy app by pointing to it in the normal way.

Post here if you find any probs with either a) Py3 compatibility and b) pip installation fails (eg. missing dependencies)

best wishes,
Jon

1 Like

You may want to do:

pip install -r requirements_suggested.txt
pip install -r requirements_dev.txt

from inside the git project too to install the additional (non-strict) dependencies

Hi Jon,

I have tried this out with Python3 - it works great! I have used it to build all my lessons, with no apparent problems (after the usual 2 -> 3 adjustments). I’m looking forward to switching to Python3.

The only issue I ran into is pip install -r requirements_suggested.txt failed because of iolabs:

Collecting iolabs (from -r requirements_suggested.txt (line 6))
  Downloading ioLabs-3.2.tar.gz (126kB)
    100% |████████████████████████████████| 133kB 3.5MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-lm_q6098/iolabs/setup.py", line 8, in <module>
        import ioLabs
      File "/tmp/pip-build-lm_q6098/iolabs/ioLabs.py", line 979
        print "USBBox connected"
                               ^
    SyntaxError: Missing parentheses in call to 'print'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lm_q6098/iolabs/

Cheers,

Damien.

I have run into an installation issue using Python2 now:

Obtaining file:///home/damien/tmp/t4/psychopy
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/damien/tmp/t4/psychopy/setup.py", line 62, in <module>
        exec(vStr)
      File "<string>", line 45, in <module>
      File "psychopy/__init__.py", line 51, in <module>
        if "configobj" not in e.msg:
    AttributeError: 'exceptions.ImportError' object has no attribute 'msg'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/damien/tmp/t4/psychopy/

I think this is because the ImportError message is called message in Python2 and msg in Python3. If I change if "configobj" not in e.msg: in __init__.py to:

if hasattr(e, "msg"):
    msg = e.msg
else:
    msg = e.message
if "configobj" not in msg:
    raise

I then run into:

> pip install -e .
Obtaining file:///home/damien/tmp/t4/psychopy
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/damien/tmp/t4/psychopy/setup.py", line 62, in <module>
        exec(vStr)
      File "<string>", line 45, in <module>
      File "psychopy/__init__.py", line 45, in <module>
        from psychopy.preferences import prefs
      File "psychopy/preferences/__init__.py", line 8, in <module>
        from . import preferences as prefsLib
      File "psychopy/preferences/preferences.py", line 4, in <module>
        from builtins import object
    ImportError: No module named builtins
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/damien/tmp/t4/psychopy/

If I update the import test:

if "configobj" not in msg and "builtins" not in msg:
    raise

All then seems to be OK.