【问题标题】:Created a Desktop Application with PyInstaller but It doesn't work on Windows使用 PyInstaller 创建了一个桌面应用程序,但它在 Windows 上不起作用
【发布时间】:2020-03-17 23:22:37
【问题描述】:

我使用 PyCharm 在我的 Mac 上用 Python 开发了一个桌面应用程序。 然后我使用 pyinstaller 打包它并尝试在 Windows 10 和 Windows 7 上使用它,但是当我尝试在 Windows 10 上运行时出现错误: 此应用无法在您的 PC 上运行,请咨询软件发行商。

我尝试在 Windows 10 上设置所有可能的设置,从 SmartScreen 到安全策略以允许外部开发人员。没有。所以我认为可能是关于 pyinstaller 的。

想法?

【问题讨论】:

  • win10是64位的吗?
  • 是的。但我将来也应该在 32 位上使用它
  • 虽然我不知道你的问题,但如果你想在 32 位和 64 位上使用这个 exe,你应该在 32 位上使用 pyinstaller
  • 希望收到关于这个问题的好提示..
  • 你需要在windows上构建才能在windows上使用。如果你在 mac 上构建,它不会工作。

标签: python windows pyinstaller


【解决方案1】:

PyInstaller 不是跨平台的。

See the documentation here.,特别是页面顶部附近的注释。

如果你想在 Windows 上运行,你必须在 Windows 上编译。 Mac OS 和 Linux 相同。

针对您的特定问题的解决方案:

  • 只需使用不同的机器进行编译,并使用相关的操作系统(如果有)。
  • Mac (VirtualBox for example) 上安装了 Windows 的虚拟机。

据我所知,没有其他方法可以解决这个问题。没有技巧或聪明的黑客攻击......对不起!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多