之前用pyinstaller时都没碰上这个问题,今天不知道什么原因就突然报这个错

pyinstaller 报错 AttributeError: 'str' object has no attribute 'decode'

即使我拿之前生成过的py文件,也时同样报错

 

解决方法:

上图已经写的很清楚了,D:\anaconda\Lib\site-packages\PyInstaller\compat 的427行报错pyinstaller 报错 AttributeError: 'str' object has no attribute 'decode'

 把427行的 out = out.decode(encoding)改为  out = out ,然后问题就解决了,重新到cmd页面中 pyinstaller -F xxx.py

相关文章: