在cmd模式下,进入py文件所在目录,然后使用pyinstaller打包exe,但是一直出现错误,ValueError: Can't mix absolute and relative paths,求助大佬们 h:\xxx>pyinstaller -F a.py 280 INFO: PyInstaller: 4.0.dev0+c6a74f060e 280 INFO: Python: 3.8.2 284 INFO: Platform: Windows-10-10.0.18362-SP0 Traceback (most recent call last): File "e:\python\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "e:\python\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\python\Scripts\pyinstaller.exe\__main__.py", line 7, in <module> File "e:\python\lib\site-packages\PyInstaller\__main__.py", line 112, in run spec_file = run_makespec(**vars(args)) File "e:\python\lib\site-packages\PyInstaller\__main__.py", line 58, in run_makespec spec_file = PyInstaller.building.makespec.main(filenames, **opts) File "e:\python\lib\site-packages\PyInstaller\building\makespec.py", line 458, in main specfile.write(onefiletmplt % d) File "e:\python\lib\site-packages\PyInstaller\building\makespec.py", line 101, in __repr__ self.variable_prefix, self.filename_suffix = make_variable_path(self.path) File "e:\python\lib\site-packages\PyInstaller\building\makespec.py", line 84, in make_variable_path if os.path.commonpath([filename, from_path]) == from_path: File "e:\python\lib\ntpath.py", line 757, in commonpath raise ValueError("Can't mix absolute and relative paths") from None ValueError: Can't mix absolute and relative paths
python3.8使用pyinstaller打包exe程序一直报错:ValueError: Can't mix absolute and relative paths
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 空白如空 2020-04-09 17:49关注
https://hxhen.com/python-os-path-model/
好像是不能相对路径和绝对路径混合使用
pyinstaller -F a.py
里面的a.py 改为绝对路径试一下
解决 无用评论 打赏 举报
悬赏问题
- ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
- ¥15 微信公众号自制会员卡没有收款渠道啊
- ¥15 stable diffusion
- ¥100 Jenkins自动化部署—悬赏100元
- ¥15 关于#python#的问题:求帮写python代码
- ¥20 MATLAB画图图形出现上下震荡的线条
- ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
- ¥15 perl MISA分析p3_in脚本出错
- ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
- ¥15 ubuntu虚拟机打包apk错误