我尝试在 Windows 上使用 pip 安装 pyinstaller,但不断遇到相同的错误。
说实话我知道从哪里开始寻找
C:\Users\t_sch\AppData\Local\Programs\Python\Python37-32\test>pip install pyinstaller
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
Installing build dependencies ... error
ERROR: Complete output from command 'c:\users\t_sch\appdata\local\programs\python\python37-32\python.exe' 'c:\users\t_sch\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\t_sch\AppData\Local\Temp\pip-build-env-a9cvo8h0\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel:
ERROR: Traceback (most recent call last):
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\__init__.py", line 4, in <module>
import locale
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\locale.py", line 16, in <module>
import re
File "c:\users\t_sch\appdata\local\programs\python\python37-32\lib\re.py", line 143, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
ERROR: Command "'c:\users\t_sch\appdata\local\programs\python\python37-32\python.exe' 'c:\users\t_sch\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\t_sch\AppData\Local\Temp\pip-build-env-a9cvo8h0\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel" failed with error code 1 in None
最佳答案
我看到您使用的是 3.7,enum34 与标准库不兼容(自 3.5 或 3.6 起)。尝试:
pip uninstall enum34
关于python - 我在使用 pip 安装 pyinstaller 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56068791/