我有一个在OS X上构建.app文件的setup.py脚本,但是我需要包含随pip一起安装的pyusb。它位于/Library/Python/2.7/site-packagespyusb-1.0.0a3-py2.7.egg
我能够在我的应用程序中使用它,但是当我尝试构建并运行它时,它不包括这种依赖性。我的设置脚本如下:
application_title = "software" #what you want to application to be called
main_python_file = "./src/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 = "Description",
options = {"build_exe" : {"includes" : includes }},
executables = [Executable(main_python_file, base = base)])
我已经看到了adding pkg_resources to my includes的答案,但是根据我的尝试,这没有成功。那么我需要在我的应用程序文件中包含pyusb。