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

删除回忆录丶 提交于 2020-01-07 03:39:06

问题


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

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/46131100/unicodedecodeerror-utf8-codec-cant-decode-byte-0xe4-in-position-4-invalid-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!