python-3.x - Pyinstaller 在 macos 上抛出错误
问题描述
我必须用一些 c++ 库来冻结 python 应用程序。我在 python 中制作了简单的文件(只是打印消息),我尝试使用pyinstaller main.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/pyinstaller", line 10, in <module>
sys.exit(run())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 791, in build
exec(code, spec_namespace)
File ".../main.spec", line 29, in <module>
console=False )
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/api.py", line 435, in __init__
upx_exclude=self.upx_exclude
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/api.py", line 197, in __init__
self.__postinit__()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
self.assemble()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/api.py", line 284, in assemble
pylib_name=pylib_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/archive/writers.py", line 334, in __init__
super(CArchiveWriter, self).__init__(archive_path, logical_toc)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/archive/writers.py", line 61, in __init__
self._add_from_table_of_contents(logical_toc)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/archive/writers.py", line 86, in _add_from_table_of_contents
self.add(toc_entry) # The guts of the archive.
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/archive/writers.py", line 375, in add
code = get_code_object(nm, pathnm)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/building/utils.py", line 625, in get_code_object
raise ValueError("Module file %s is missing" % filename)
ValueError: Module file .../main.py is missing
我不知道该怎么办。谷歌什么都没有。我尝试重新安装 pyinstaller。
解决方案
推荐阅读
- logging - LoggerMessage 字符串插值不起作用 - NLOG 和 Azure 表存储
- date - 带有日期变量的 SSIS For 循环容器
- mysql - MySQL导入脚本添加额外的行?
- android - 使用多个自定义首选项会搞砸、布局、首选项标题和共享首选项值
- javascript - 获取 javascript - 未捕获的类型错误:
- definition - C#语言规范说明:6.2.4 显式引用转换
- cpu-architecture - gem5 简单配置脚本上的“连续 SC 失败”
- elasticsearch - Logstash 无法启动 - 错误:此时 tibrvnativesd.jar 出乎意料
- visual-studio-code - 摩卡在 npm 测试中没有失败
- python - 如何将 python 连接到 Azure Cloud 并创建 azure 数据工厂