1、AttributeError: module 'enum' has no attribute 'IntFlag'
【可能原因】:这可能是由包enum34引起的。 从python 3.4开始,有一个标准的库enum模块,所以你应该卸载enum34,它不再与标准库中的枚举兼容,因为在python 3.6中添加了enum.IntFlag.
【解决方法】:卸载enum34. pip uninstall enum34
2、ModuleNotFoundError: No module named 'setuptools._vendor'
【可能原因】:找不到与setuptools._vendor有关的信息,感觉和setuptools本身的版本有关。
【解决方法】:使用pip install --upgrade setuptools
或者:python -m pip install --upgrade --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple setuptools
3、WARNING: Unable to find Qt5 translations C:/qt5b/qt_1524647842210/_h_env/Library/translations\qtbase_*.qm. These translations were not packaged.
【可能原因】:Conda 4.5.11, Python 3.6.4, PyInstaller 3.4
插件路径在hooks / qt.py中未正确确定。 Qt要求在任何其他调用之前首先实例化QCoreApplication。
My qt.py hook is in ~\anaconda3\Lib\site-packages\PyInstaller\utils\hooks\qt.py
找到下面的内容位置,替换为下面的内容。
json_str = exec_statement("""
import sys
# exec_statement only captures stdout. If there are
# errors, capture them to stdout so they can be displayed to the
# user. Do this early, in case PyQt5 imports produce stderr
# output.
sys.stderr = sys.stdout
import json
from %s.QtCore import QLibraryInfo, QCoreApplication
# QLibraryInfo isn't always valid until a QCoreApplication is
# instantiated.
app = QCoreApplication([])
paths = [x for x in dir(QLibraryInfo) if x.endswith('Path')]
location = {x: QLibraryInfo.location(getattr(QLibraryInfo, x))
for x in paths}
try:
version = QLibraryInfo.version().segments()
except AttributeError:
version = None
print(str(json.dumps({
'isDebugBuild': QLibraryInfo.isDebugBuild(),
'version': version,
'location': location,
})))
""" % self.namespace)