Failed to build stand-alone application on Mac OS X Yosemite (10.10) with cx_Freeze

断了今生、忘了曾经 提交于 2019-12-05 18:48:06

I recommend you do a few things here (hopefully solving two issues I can identify):

  • Using Mac OS X's system Python (not recommended)
  • Using old and unmaintained cx_Freeze

First let's fix your Python installation! The recommended approach is to use Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
brew install python

Now you should have a good installation of Python in /usr/local that's separate from your Mac OS X system Python so you can keep things clean and separate. You should also have followed any recommended instructions from the above installation. Typically this involves modifying your $PATH:

export PATH="/usr/local/bin:$PATH"

Note: Normally you should modify your $HOME/.bashrc or $HOME/.profile depending on how you have your Terminal configured.

You should now also have pip form /usr/local/bin/pip available as well.

Now on to a better replacement for cx_freeze -- The recommended and more maintained approach these days is to use pyInstaller:

pip install pyinstaller
pyinstaller -F /path/to/my/script.py

For more complex requirements and builds please follow pyinstaller's documentation on Using sepc files

Good luck!

Note: This should also fix your TCL/TK problem as well hopefully!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!