【问题标题】:pyInstaller not installing for python3pyInstaller 没有为 python3 安装
【发布时间】:2023-04-02 14:38:01
【问题描述】:

当我发布这篇文章时,pyInstaller.org 网站似乎已关闭。

我正在尝试为 python3 安装 pyInstaller。我都试过了:

"c:\python34\scripts\easy_install.exe" pyInstaller "c:\python34\scripts\pip.exe" 安装pyInstaller

但两者都给出:

PyInstaller\compat.py", line 129
    if sys.maxint > 2L ** 32:
                     ^
SyntaxError: invalid syntax

适用于 python27 pyInstaller 与 python3 不兼容吗?如果没有,我应该如何为 Windows 制作我的 pyqt5 脚本的独立应用程序?

【问题讨论】:

  • 您的互联网可能存在一些问题,因为pyinstaller.org 似乎可以正常工作

标签: python python-3.x pip pyinstaller pyqt5


【解决方案1】:

PyInstaller 2.1 尚不兼容 Python 3.x。您要么需要切换到 Python 2.x,要么等到该项目与 Python 3.x 兼容,您可以在 PyPI 页面上进行检查,因为它应该已经更新了将其标记为“Python 3.x”的分类器。 x”兼容。目前的标签是:

Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.4
Programming Language :: Python :: 2.5
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2 :: Only

【讨论】:

    【解决方案2】:

    一个experimental branch on GitHub 已发布,适用于 Python 3。

    只需下载或克隆它并运行。

    或者,use this fork,它修复了一些错误,例如--version-file=... 支持和 PyQt5 多媒体支持和打印服务。

    【讨论】:

    • 谢谢!我在支持 PyQt5 媒体的 py2exe 上遇到问题,所以我使用了你建议的 fork。完美运行。非常感谢!
    • github上的实验分支链接失效了。
    • 可能与分支的链接相关:github.com/pyinstaller/pyinstaller/issues/1417
    【解决方案3】:

    Pyinstaller 与 python 3 兼容,但它应该专门为该版本安装,简单的方法是这样的(windows/linux):

    pip3 install pyinstaller
    

    把它放在 CMD (windows) 或终端 (linux) 中。注意pip3。 python 安装目录必须在 PATH 环境变量中(linux /windows)才能使用 pip。

    在 PATH 变量中获取 python 库的一种简单方法是在安装程序中选中下面显示的框。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-31
      • 2018-04-25
      • 1970-01-01
      • 2017-02-16
      • 2022-12-17
      • 2018-11-14
      • 2016-07-12
      • 2012-05-06
      相关资源
      最近更新 更多