ImportError Psychopy 3.2020.2.10

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): Psychopy 3.2020.2.10
**Standard Standalone? (y/n)Y If not then what?:
**What are you trying to achieve?:*Running a simple go/no-go task with sending triggers to the EEG system through the parallel port *
I have used letters from an Indian orthograpy (e.gs. അ ಅ) in my trials.
**What did you try to make it work?:Just located the error line

**What specifically went wrong when you tried that?:After running a few trials, the experiment stopped abruptly
Include pasted full error message if possible. “That didn’t work” is not enough information.

TypeError: ord() expected a character, but string of length 2 found
Exception ignored in: <bound method TextStim.del of <psychopy.visual.text.TextStim object at 0x0000012C3BE9A6D8>>
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\text.py”, line 240, in del
File “C:\Program Files\PsychoPy3\lib\site-packages\pyglet\gl\lib.py”, line 97, in errcheck
ImportError: sys.meta_path is None, Python is likely shutting down

Experiment ended.

Hi. Did you solve the problem? I have a similar issue.

I get the same thing after upgrading from Mac OS Mojave to Big Sur (11.1), and upgrading PsychoPy to 2020.2.10 (before, I was using 2020.2.3, but was forced to upgrade due to the issues with Big Sur on that version). The error happens at the end of the experiment, and I can’t really see any actual negative effects, but it doesn’t feel great to have an error pop up all the time.

I tried isolating what’s causing the error and it seems bizarre to me. Here’s a minimal example:

test_syspatherr.psyexp (6.5 KB)

Based on the error message, it seems like first an exception is thrown by the __del__ method of TextStim. So of course, you need a TextStim object. Apart from that, it’s enough for me at least to just add a single code component, with this:

def foobar(a):
    return a

It doesn’t seem to matter what the function does, or what it’s named. If I just define any kind of function in a code component, and I have a text component, then I get the error.

Below is all output generated by running the above experiment:

## Running: /Users/workingman/Desktop/TEMPCOPY_disembedding_task/test_syspatherr_lastrun.py ##
1984.6139     INFO     Loaded monitor calibration from ['2020_09_28 16:56']
0.7397     WARNING     We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
7.4452     WARNING     t of last frame was 21.39ms (=1/46)
2021-02-01 09:45:35.475 python[71049:1336796] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/7q/7fxv4sl52jj6v9ghyt1zwvzh0000gq/T/org.opensciencetools.psychopy.savedState
Exception ignored in: <bound method TextStim.__del__ of <psychopy.visual.text.TextStim object at 0x7feee0574a58>>
Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/visual/text.py", line 240, in __del__
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/gl/lib.py", line 99, in errcheck
ImportError: sys.meta_path is None, Python is likely shutting down
##### Experiment ended. #####

As you said the error message is due to a bug in the __del__ function of Text, I think this is now fixed (looking at the Git history at least) so shouldn’t be a problem in the next version of PsychoPy.

As for the error itself, what happens if you use a Textbox rather than Text component?