Python3 dependency incompatibility on conda

OS OSX 10.11.6
PsychoPy version 1.90.2
Standard Standalone? (y/n) no. anaconda

I’m trying to install psychopy using python3 using conda. Installation does not give warnings.

Running command:

conda install -c conda-forge pyglet pysoundfile python-bidi moviepy pyosf

downgrades the python version to 3.5.5 if already higher. Experimentation shows that its pyglet that is responsible.

However, when trying to open up the builder I get the following error:

(psypy3) $ python /path/to/anaconda3/envs/psypy3/bin/psychopyApp.py Traceback (most recent call last): File "/path/to/anaconda3/envs/psypy3/bin/psychopyApp.py", line 91, in <module> core.shellCall(cmd, env=dict(env, PYTHONW='True')) File "/path/to/anaconda3/envs/psypy3/lib/python3.5/site-packages/psychopy/core.py", line 158, in shellCall raise RuntimeError(msg) RuntimeError: shellCall() requires Python 2.7, or 3.6 and newer.

Looking at the code of core.py, I see:

Notes ----- We use ``subprocess.Popen`` to execute the command and establishstdinandstdoutpipes. Python 2.7 always opens the pipes in text mode; however, Python 3 defaults to binary mode, unless an encoding is specified. To unify pipe communication across Python 2 and 3, we now provide anencodingparameter, enforcingutf-8text mode by default. This parameter is present from Python 3.6 onwards; using an older Python 3 version will raise an exception. The parameter will be ignored when running Python 2.7.

Note: installing pyglet using pip solves this compatibility issue, but only if you do not follow the instructions on the psychopy installation page and create an environment with python=3.5.

Unfortunately, then when trying to run an experiment I get the lovely:

2018-07-09 15:46:20.117 python[66251:5069486] -[NSApplication transformToForegroundApplication]: unrecognized selector sent to instance 0x7fe1930eb8e0
2018-07-09 15:46:20.119 python[66251:5069486] An uncaught exception was raised
2018-07-09 15:46:20.119 python[66251:5069486] -[NSApplication transformToForegroundApplication]: unrecognized selector sent to instance 0x7fe1930eb8e0
2018-07-09 15:46:20.119 python[66251:5069486] (
0 CoreFoundation 0x00007fff9617f452 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8f34ff7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff961e918d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff960ef4c1 forwarding + 1009
4 CoreFoundation 0x00007fff960ef048 _CF_forwarding_prep_0 + 120
5 libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x0000000108d2027e _ZN5wxApp9DoInitGuiEv + 478
6 _core.cpython-36m-darwin.so 0x0000000108646d8e _ZN10sipwxPyApp9OnInitGuiEv + 110
7 libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x0000000108d6fca2 _ZN5wxApp10InitializeERiPPw + 242
8 libwx_baseu-3.0.0.4.0.dylib 0x000000010936ce53 _Z12wxEntryStartRiPPw + 179
9 _core.cpython-36m-darwin.so 0x0000000108646336 _ZN7wxPyApp13_BootstrapAppEv + 518
10 _core.cpython-36m-darwin.so 0x000000010864ae62 ZL26meth_wxPyApp__BootstrapAppP7_objectS0 + 114
11 python 0x00000001030fe078 _PyCFunction_FastCallDict + 200
12 python 0x00000001031d522f call_function + 143
13 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
14 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
15 python 0x00000001031d5e05 _PyFunction_FastCallDict + 373
16 python 0x000000010307cb90 _PyObject_FastCallDict + 320
17 python 0x00000001030a4168 method_call + 136
18 python 0x00000001030841fe PyObject_Call + 62
19 python 0x0000000103125385 slot_tp_init + 117
20 python 0x00000001031298d1 type_call + 241
21 python 0x000000010307cb01 _PyObject_FastCallDict + 177
22 python 0x00000001031d5328 call_function + 392
23 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
24 python 0x00000001031d55ec fast_function + 188
25 python 0x00000001031d528c call_function + 236
26 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
27 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
28 python 0x00000001031d569a fast_function + 362
29 python 0x00000001031d528c call_function + 236
30 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
31 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
32 python 0x00000001031d5e05 _PyFunction_FastCallDict + 373
33 python 0x000000010307cb90 _PyObject_FastCallDict + 320
34 python 0x00000001030a4168 method_call + 136
35 python 0x00000001030841fe PyObject_Call + 62
36 python 0x0000000103125385 slot_tp_init + 117
37 python 0x00000001031298d1 type_call + 241
38 python 0x000000010307cb01 _PyObject_FastCallDict + 177
39 python 0x0000000103084d67 _PyObject_FastCallKeywords + 327
40 python 0x00000001031d5328 call_function + 392
41 python 0x00000001031d3006 _PyEval_EvalFrameDefault + 47398
42 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
43 python 0x000000010321edac PyRun_FileExFlags + 252
44 python 0x000000010321e50e PyRun_SimpleFileExFlags + 366
45 python 0x0000000103244f46 Py_Main + 3734
46 python 0x0000000103074c19 main + 313
47 libdyld.dylib 0x00007fff905305ad start + 1
48 ??? 0x0000000000000003 0x0 + 3
)
2018-07-09 15:46:20.119 python[66251:5069486] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSApplication transformToForegroundApplication]: unrecognized selector sent to instance 0x7fe1930eb8e0’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9617f452 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8f34ff7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff961e918d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff960ef4c1 forwarding + 1009
4 CoreFoundation 0x00007fff960ef048 _CF_forwarding_prep_0 + 120
5 libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x0000000108d2027e _ZN5wxApp9DoInitGuiEv + 478
6 _core.cpython-36m-darwin.so 0x0000000108646d8e _ZN10sipwxPyApp9OnInitGuiEv + 110
7 libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x0000000108d6fca2 _ZN5wxApp10InitializeERiPPw + 242
8 libwx_baseu-3.0.0.4.0.dylib 0x000000010936ce53 _Z12wxEntryStartRiPPw + 179
9 _core.cpython-36m-darwin.so 0x0000000108646336 _ZN7wxPyApp13_BootstrapAppEv + 518
10 _core.cpython-36m-darwin.so 0x000000010864ae62 ZL26meth_wxPyApp__BootstrapAppP7_objectS0 + 114
11 python 0x00000001030fe078 _PyCFunction_FastCallDict + 200
12 python 0x00000001031d522f call_function + 143
13 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
14 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
15 python 0x00000001031d5e05 _PyFunction_FastCallDict + 373
16 python 0x000000010307cb90 _PyObject_FastCallDict + 320
17 python 0x00000001030a4168 method_call + 136
18 python 0x00000001030841fe PyObject_Call + 62
19 python 0x0000000103125385 slot_tp_init + 117
20 python 0x00000001031298d1 type_call + 241
21 python 0x000000010307cb01 _PyObject_FastCallDict + 177
22 python 0x00000001031d5328 call_function + 392
23 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
24 python 0x00000001031d55ec fast_function + 188
25 python 0x00000001031d528c call_function + 236
26 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
27 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
28 python 0x00000001031d569a fast_function + 362
29 python 0x00000001031d528c call_function + 236
30 python 0x00000001031d2f56 _PyEval_EvalFrameDefault + 47222
31 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
32 python 0x00000001031d5e05 _PyFunction_FastCallDict + 373
33 python 0x000000010307cb90 _PyObject_FastCallDict + 320
34 python 0x00000001030a4168 method_call + 136
35 python 0x00000001030841fe PyObject_Call + 62
36 python 0x0000000103125385 slot_tp_init + 117
37 python 0x00000001031298d1 type_call + 241
38 python 0x000000010307cb01 _PyObject_FastCallDict + 177
39 python 0x0000000103084d67 _PyObject_FastCallKeywords + 327
40 python 0x00000001031d5328 call_function + 392
41 python 0x00000001031d3006 _PyEval_EvalFrameDefault + 47398
42 python 0x00000001031c6519 _PyEval_EvalCodeWithName + 425
43 python 0x000000010321edac PyRun_FileExFlags + 252
44 python 0x000000010321e50e PyRun_SimpleFileExFlags + 366
45 python 0x0000000103244f46 Py_Main + 3734
46 python 0x0000000103074c19 main + 313
47 libdyld.dylib 0x00007fff905305ad start + 1
48 ??? 0x0000000000000003 0x0 + 3
)