如果使用.spec文件的话,在该文件中找到console=True修改为console=False如果是直接指定python文件进行pyinstaller打包的话,需要添加--noconsole例如pyinstallermycode.py--noconsole