PyInstaller 不会安装,Python 3.6.0a4 和 x64 Windows

PyInstaller won't install, Python 3.6.0a4 and x64 Windows

我说的是 Python 版本(来自 https://www.python.org/downloads/windows/)和 x64 Windows 10。 每次我尝试执行 "pip install pyinstaller" 它都会因错误而崩溃:

C:\WINDOWS\system32>pip install pyinstaller
Collecting pyinstaller
  Using cached PyInstaller-3.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\jskurski\appdata\local\programs\python\python36\lib\site-packages (from pyinstaller)
Collecting pefile (from pyinstaller)
  Using cached pefile-2016.3.28.tar.gz
Collecting pypiwin32 (from pyinstaller)
  Using cached pypiwin32-219.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\setup.py", line 121
        print "Building pywin32", pywin32_version
                               ^
    SyntaxError: Missing parentheses in call to 'print'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\

所以,对我来说似乎有一个版本 msmatch 之类的。不幸的是,我自己也想不通。

有什么建议吗? 有没有人在 Windows 上成功使用 PyInstaller 和最新的 3.6 Python?或者我应该将 Python 降级到旧版本?

编辑:在另一台 PC 上测试(相同的环境),结果是一样的。

edit2:似乎可以在 3.5.2 版本上运行,所以目前可能是一个可行的方法。

正如 cdarke 所指出的,你是 运行 python 2 Python 3.

试试这个:

pip3 install pyinstaller

pyinstaller 需要 pypiwin32 模块。 当 pip 尝试安装它时,它显示错误,因为 python3.6

没有 pypiwin32

我的案例已结案,因为我已降级到稳定版 3.5.2。可能是该 alpha 版本中的一些不一致导致了这种情况。我只是想写一个简单的 GUI Windows 程序,所以我不会进一步研究。

您必须根据您的 python 版本手动安装 pywin32。以下link可以下载。

https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/

使用正确版本的 python 安装 pywin32 后。必须安装 Pyinstaller