简体   繁体   中英

UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 4: invalid continuation byte

I actually have no Idea how to solve this, cause I never used Python before. I just can use Psychopy to generate a script in Python, but I dont find the mistake here. Would be great if you know the answer or you can give me a hint how to find one!:

###################### Running: D:\LTD_Liste1_lastrun.py #######################
pyo version 0.8.5 (uses single precision)
Traceback (most recent call last):
  File "D:\LTD_Liste1_lastrun.py", line 77, in <module>
    Target = sound.Sound('A', secs=-1)
  File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py", line 279, in __init__
    init(rate=sampleRate)
  File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py", line 128, in init
    audioDriver, outputID = _bestDriver(devNames, devIDs)
  File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py", line 26, in _bestDriver
    preferredDrivers = prefs.general['audioDriver']
  File "C:\Program Files\PsychoPy2\lib\site-packages\configobj.py", line 563, in __getitem__
    new = [_check(entry) for entry in val]
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 4: invalid continuation byte

This sound like the utf8-encoding bug in the 1.85.3 version that appears mainly on windows 7. If you try to go to File > Preferences and the same error appears, then it is most likely this bug.

The solution, that worked for me was to uninstall version 1.85.3 and install 1.85.2

Feel free to delete/edit my answer, as soon as this bug is fixed.

you can try to remove 'pyo' from the audio library (Preference -> General) and just keep ['pygame']. It worked for me on Windows 10. I "found" this solution thanks to the comment of @hoechenberger. Huge thanks to her/him.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM