简体   繁体   English

如何使用 Mac 将 python 脚本交叉编译成可执行文件?

[英]How can I cross compile a python script into an executable using Mac?

On a Mac I haven't been able to cross compile my python code into a stand-alone executable.在 Mac 上,我无法将 python 代码交叉编译成独立的可执行文件。 Using Pyinstaller or Py2exe only compiles it into a file thats supported by Mac, I think this is because cross compiling is not supported, but I saw a post saying you can use Wine, Im not sure how to go about doing it since I'm pretty new to python.使用 Pyinstaller 或 Py2exe 只会将它编译成 Mac 支持的文件,我认为这是因为不支持交叉编译,但我看到一个帖子说你可以使用 Wine,我不确定如何 go 关于这样做,因为我python 相当新。

Hello, check out this options:您好,请查看以下选项:

Single executable (all platforms)单个可执行文件(所有平台)

  • PyInstaller - the most active(Could also be used with PyQt ) PyInstaller - 最活跃的(也可以与PyQt一起使用)
  • fbs - if you chose Qt above fbs - 如果您在上面选择 Qt

Single executable (Windows)单个可执行文件 (Windows)

  • py2exe - used to be the most popular py2exe - 曾经是最流行的

Single executable (Linux)单个可执行文件 (Linux)

  • Freeze - works the same way like py2exe but targets Linux platform冻结- 工作方式与 py2exe 相同,但针对 Linux 平台

Single executable (Mac)单个可执行文件 (Mac)

  • py2app - again, works like py2exe but targets Mac OS py2app - 同样,像 py2exe 一样工作,但针对 Mac OS

Hope it help.希望它有所帮助。 Good luck.祝你好运。

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

相关问题 如何将python脚本编译为可执行文件? - How to compile a python script to an executable? 如何从 Windows 中的 Python 脚本创建可在 Mac 上运行的可执行文件? - How to create an executable from a Python script in Windows that can run on a Mac? 如何使用 cython 编译 python 脚本导入模块到可执行文件 - How to compile python script importing modules to executable using cython 如何将python脚本编译为二进制可执行文件 - How to compile python script to binary executable 如何编译python文件可执行文件和不同的体系结构 - How can I compile a python file executable and different architectures 如何从 Mac 上的另一个可执行文件/Python 脚本调用可执行文件? - How to make a call to an executable from another executable/Python script on Mac? 我可以使用Python 2.7中的PyInstaller来为Python 3脚本编译可执行文件吗? - Can I use PyInstaller from Python 2.7 to compile an executable for a Python 3 script? 如何使用python脚本运行可执行文件,并提供.dat文件作为输入? - How can I run an executable using python script, giving a .dat file as input? 如何将我的 Python 脚本制作成适用于 Mac 的 Executable .dmg 文件? - How do I make my Python Script into an Executable .dmg file for Mac? 如何将Python脚本编译成Unix可执行文件并使其不可读? - How to compile a Python script into a Unix executable and make it unreadable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM