cx_freeze找不到python 3路径mac

时间:2014-11-21 20:43:58

标签: macos python-3.x pyqt cx-freeze

当我尝试生成应用程序可执行文件时遇到此问题。我按照example进行操作,因此设置代码为

application_title = "app_name" #what you want to application to be called
main_python_file = "main.py" #the name of the python file you use to run the program

import sys

from cx_Freeze import setup, Executable

base = None
if sys.platform == "win32":
    base = "Win32GUI"

includes = ["atexit","re"]

setup(
        name = application_title,
        version = "0.1",
        description = "Sample cx_Freeze PyQt4 script",
        options = {"build_exe" : {"includes" : includes }},
        executables = [Executable(main_python_file, base = base)])

然后我去我的终端并按

python setup.py bdist_mac

由于某种原因,我不知道如何解决我得到这个输出,并且文件没有生成

running bdist_mac
running build
running build_exe
copying /Applications/anaconda/lib/python3.4/site-packages/cx_Freeze/bases/Console -> build/exe.macosx-10.5-x86_64-3.4/main
copying /opt/local/Library/Frameworks/Python.framework/Versions/3.4/Python -> build/exe.macosx-10.5-x86_64-3.4/Python
error: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.4/Python'

我已经安装了Python 3.4和cx_freeze的anaconda。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,除了anaconda之外还安装了一个单独的python。它似乎与此处的问题类似

py2app is not copying the Python.framework to the new app while using virutalenv