安装pyinstaller之后用的时候出现了这个问题
File "C:\Users\陈风\AppData\Local\Programs\Python\Python37-32\Scripts\pyinstaller-script.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xb3' in file C:\Users\陈风\AppData\Local\Programs\Python\Python37-32\Scripts\pyinstaller-script.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
于是打开对应的.py文件发现是这样子的。
#!c:\users\³Â·ç\appdata\local\programs\python\python37-32\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==3.4','console_scripts','pyinstaller'
__requires__ = 'PyInstaller==3.4'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
)
# -*- coding:utf-8 -*-
问题解决。
欢迎访问陈风的个人博客