pyinstaller无法把plyer打包进去?
本帖最后由 qianaonan 于 2023-3-1 19:53 编辑源py中引用了以上语句,用pycharm执行后会有提示窗,但是用pyinstaller打包后就没有提示窗,这个要怎么弄?
打包的时候加上--hidden-import plyer.platforms.win.notification 源代码发一下 土鸡炖蘑菇 发表于 2023-3-1 15:39
源代码发一下
from plyer import notification
message = '你有新流程待办'
notification.notify(title="流程提醒",
message=message,
timeout=10) qianaonan 发表于 2023-3-1 15:45
from plyer import notification
message = '你有新流程待办'
notification.notify(title="流程提醒",
...
已找到解决办法,去悬赏区 开个贴 悬赏币 我发给你解决方法。。 和spec没关系
ALDShD 发表于 2023-3-1 15:54
你把打包的 spec 文件贴出来看看
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['流程提醒.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=['plyer.platforms.win.notification'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='流程提醒',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['wx.ico'],
)
本帖最后由 qianaonan 于 2023-3-1 16:20 编辑
ALDShD 发表于 2023-3-1 16:12
你执行的时候是任何反应都没有 吗?报错都没有?
Traceback (most recent call last):
File "plyer\utils.py", line 96, in _ensure_obj
ModuleNotFoundError: No module named 'plyer.platforms'
Traceback (most recent call last):
File "流程提醒.py", line 136, in 按钮2_按钮被单击
File "plyer\facades\notification.py", line 87, in notify
File "plyer\facades\notification.py", line 93, in _notify
NotImplementedError: No usable implementation found!
页:
[1]