- 问题描述:
安装pyinstaller失败
ERROR: Command errored out with exit status 1:
command: 'D:\Software\Python3\python3.exe' 'D:\Software\Python3\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Du\AppData\Local\Temp\pip-build-env-ujzssa11\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (14 lines):
Traceback (most recent call last):
File "D:\Software\Python3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Software\Python3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Software\Python3\lib\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "D:\Software\Python3\lib\site-packages\pip\_internal\cli\main.py", line 5, in <module>
import locale
File "D:\Software\Python3\lib\locale.py", line 16, in <module>
import re
File "D:\Software\Python3\lib\re.py", line 145, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Software\Python3\python3.exe' 'D:\Software\Python3\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Du\AppData\Local\Temp\pip-build-env-ujzssa11\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
- 问题解决
1.升级pip
2.重新安装,如果还是报错,检查报错信息:AttributeError: module 'enum' has no attribute 'IntFlag'
3.可能你安装的不是enum标准库,从python 3.6开始,enum34库不再与标准库兼容。该库也是不必要的,因此您只需卸载它即可
python3 -m pip uninstall enum34
- 重新安装pyinstaller 就不会报错
问题解决!!!