PyArmor ERROR 'utf-8' codec can't decode byte 0x83 in position 594: invalid start byte

半腔热情 提交于 2021-01-29 14:40:54

问题


I am developing with Python, and tried to make an installer by typing the following command in PyArmor.

pyarmor pack -e " --onedir --noconsole --icon icon.ico -n testApp" main.py

Then I got the following error.

ERROR    'utf-8' codec can't decode byte 0x83 in position 594: invalid start byte

There is no error when I type and execute python main.py.

An error occurs only when PyArmor is running.

What is the cause? How can I fix it?


回答1:


As it says in the documentation: https://pyarmor.readthedocs.io/en/latest/questions.html#xxx-codec-can-t-decode-byte-0xxx

You should put at the beginning of the script: # -*- coding: utf-8 -*-




回答2:


I don't know why, but changing the script execution folder solved the problem.

If I put main.py in C: \ Users \ username \ Documents \ testApp folder and cd C: \ Users \ username \ Documents \ testApp, then I get an error.

However, when I put main.py in C: \ Users \ username \ Desktop \ testApp folder and cd C: \ Users \ username \ Desktop \ testApp, the error disappeared.

It is very strange.



来源:https://stackoverflow.com/questions/60391524/pyarmor-error-utf-8-codec-cant-decode-byte-0x83-in-position-594-invalid-star

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