在用pyinstaller打包py文件时遇到AttributeError: 'str' object has no attribute 'items'等问题

一、AttributeError: ‘str’ object has no attribute ‘items’
1.可能是你的setuptools版本比较老,更新一下seetuptools:pip install --upgrade setuptools
如果还没解决的话,下一步
2.pip uninstall enum34 卸载掉这个
二、然后遇到这个问题在用pyinstaller打包py文件时遇到AttributeError: 'str' object has no attribute 'items'等问题解决办法一:修改生成的spac文件,在hiddenimports里输入模块名
在用pyinstaller打包py文件时遇到AttributeError: 'str' object has no attribute 'items'等问题然后以此spec文件打包python
在用pyinstaller打包py文件时遇到AttributeError: 'str' object has no attribute 'items'等问题
解决办法二:在用pyinstaller打包py文件时加入–hidden-import numpy.core._dtype._ctypes(这部分填写缺少的模块名)
完整代码:pyinstaller --hidden-import numpy.core._dtype._ctypes(这里填你缺少的模块名) -F
yourfilename.py(yourfilename.py即你想打包的文件名)
最后就可以顺利打开exe文件了