在 Windows 10 上为 Python 3.7 安装 PyInstaller 时出错

Error Installing PyInstaller for Python 3.7 on Windows 10

我在 Windows 10 上使用命令 pip install pyinstaller 为 Python 3.7 安装程序 PyInstaller,但命令提示符给了我以下错误:

ModuleNotFoundError: No module named 'pywintypes'
...
ModuleNotFoundError: No module named 'cffi'
...
During handling of the above exception, another exception occurred:
...
SyntaxError: invalid syntax
----------------------------------------`

Command "python setup.py egg_info" failed with error code 1 in C:\Users\MUHAMM~1\AppData\Local\Temp\pip-install-6_q2lzs2\pyinstaller\

我安装了 midule cffi,然后尝试安装 pywintypes 但没有找到。

有什么帮助吗?提前致谢。

更新 截至 2019-07-09

PyInstaller==3.5 的变更日志确实声明他们现在在 Windows 10 上支持 Python 3.7。 我更新了我的答案,以解决几个 necro-bumps "it works now"、"the second answer should be accepted" 和 "downvotes",而不管问题被问到的时间。第二个答案不是当时的实际解决方案,它显然没有说明

pip3.7 install PyInstaller==3.5

自 2019 年 7 月 9 日以来是一个可靠的修复程序。然而,这个问题早在那个日期之前就被问到了。


之前 2019-07-09

无法解决您的问题,但是 PyInstaller 不支持 Python 3.7.

我遇到了这个问题。 解决方案是

python -m pip install pip==18.1

然后

python -m pip install -U pyinstaller

Python 3.7 版本的 Pyinstaller 工作正常

python3.7

请使用以下安装
pip install pyinstaller==4.0 --no-build-isolation

以下是对我有用的方法:

通过键入以下命令将 pip 降级到 18.1:

python -m pip install pip==18.1

之后 运行 :

python -m pip install -U pyinstaller

它应该可以毫无错误地完成它。然后你可以升级pip

python -m pip install –upgrade pip

你应该先降级 pip:

python -m pip install pip==18.1

然后尝试安装 pyinstaller:

python -m pip install -U pyinstaller

由于有较新的 pip 版本,您可能会注意到安装结束时的橙色警告:

You are using pip version 18.1, however version 21.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

继续安装更新版本的 pip。