Re: About the error ( UnicodeDecodeError: 'utf-8' codec can't decode)form logger.py
On 4/16/24 8:22 AM, c00jsw00 wrote: > thanks for your help. When I use win 11 (anaconda powershell) to run a > simple python input and got the error. ... > File "D:\conda\Library\modeller\modlib\modeller\util\logger.py", line 8, > in Logger > _header = _modeller.mod_header_get() > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > UnicodeDecodeError: 'utf-8' codec can't decode byte 0xaa in position > 957: invalid start byte
Ah, I see the problem. It is trying to print the start of the Modeller log file, which has information on the Modeller version and environment. Position 957 is about where your computer name is. We assume that name is valid ASCII or UTF8 (and nobody's reported this error before!) but I suppose it doesn't have to be, particularly in non-Western locales. We'll fix this issue for the next Modeller release. In the meantime you could work around it in one of two ways:
1. Change your computer name in Control Panel to something containing only plain ASCII (e.g. try "XXX") and reboot.
or
2. Edit logger.py in your Modeller installation, i.e. D:\conda\Library\modeller\modlib\modeller\util\logger.py and change line 8 from
_header = _modeller.mod_header_get()
to
_header = ' '
Ben Webb, Modeller Caretaker
participants (1)
-
Modeller Caretaker