Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用pyinstaller在Mac上创建独立文件_Python_User Interface_Tkinter_Pyinstaller - Fatal编程技术网

Python 使用pyinstaller在Mac上创建独立文件

Python 使用pyinstaller在Mac上创建独立文件,python,user-interface,tkinter,pyinstaller,Python,User Interface,Tkinter,Pyinstaller,我正在尝试使用pyinstaller和python 2.7版制作一个独立的文件,该文件将运行我使用tkinter制作的一个小应用程序,但是我在阅读文档时遇到了问题。我找到了,但它适用于python 2.5和windows 我在桌面上创建了两个文件夹,一个用于pyinstaller,另一个包含我的文件 在终端中,我将目录更改为pyinstaller文件夹。然后我键入以下内容: python pyinstaller.py /Users/.../Desktop/BuildFolder/menu.py

我正在尝试使用pyinstaller和python 2.7版制作一个独立的文件,该文件将运行我使用tkinter制作的一个小应用程序,但是我在阅读文档时遇到了问题。我找到了,但它适用于python 2.5和windows

我在桌面上创建了两个文件夹,一个用于pyinstaller,另一个包含我的文件

在终端中,我将目录更改为pyinstaller文件夹。然后我键入以下内容:

python pyinstaller.py /Users/.../Desktop/BuildFolder/menu.py
//buildfolder contains my files, menu.py is the file I run to start the app
运行时,我会收到一条消息,内容是“输出目录及其所有内容都将被删除。是否继续?”选择“是”,然后创建目录

/Users/.../Desktop/pyinstaller-2.0/menu
在菜单文件夹中,有一个.SPEC文件。因此,我在terminal中运行以下命令

python pyinstaller.py /Users/.../Desktop/BuildFolder/menu/menu.spec
运行之后,我在该文件夹中找到了一个.PKG文件,但它的标签与menu.py完全不同。我不知道下一步要做什么,我也不确定是否应该运行其他文件。

我不确定(还没有尝试过),但也许您在使用.SPEC文件时必须运行Build.py