简体   繁体   English

如何运行Mac机导出的window中的.exe文件

[英]How to run the .exe file in window exported from Mac machine

I am writing in Python and trying to export it as a.exe file from Mac machine.我正在写 Python 并试图从 Mac 机器将其导出为 a.exe 文件。 I tried to export it by auto-py-to-exe and it works well in my Mac machine.我尝试通过 auto-py-to-exe 导出它,它在我的 Mac 机器上运行良好。 However, I found that it could not be opened in Window even I add the '.exe' after its file name.但是,我发现在Window即使我在文件名后面加上'.exe'也打不开。 Is there any way to fix it or I can only export it in a Window machine?有什么方法可以修复它还是我只能在 Window 机器上导出它? Thanks!谢谢!

auto-py-to-exe seems to be a graphical interface for PyInstaller. auto-py-to-exe 似乎是 PyInstaller 的图形界面。 According to the official PyInstaller docs根据官方 PyInstaller 文档

If you need to distribute your application for more than one OS, for example both Windows and Mac OS X, you must install PyInstaller on each platform and bundle your app separately on each.如果您需要为多个操作系统分发您的应用程序,例如 Windows 和 Mac OS X,您必须在每个平台上安装 PyInstaller 并在每个平台上单独捆绑您的应用程序。

You can do this from a single machine using virtualization.您可以使用虚拟化从一台机器上执行此操作。 The free virtualBox or the paid VMWare and Parallels allow you to run another complete operating system as a “guest”.免费的 virtualBox 或付费的 VMWare 和 Parallels 允许您以“访客”身份运行另一个完整的操作系统。 You set up a virtual machine for each “guest” OS.您为每个“来宾”操作系统设置了一个虚拟机。 In it you install Python, the support packages your application needs, and PyInstaller.在其中安装 Python、应用程序所需的支持包和 PyInstaller。

So you would need to build it on a Windows or Windows VM to get it to work on Windows.因此,您需要在 Windows 或 Windows VM 上构建它才能使其在 Windows 上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM