Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跟众多其他人的建议一样,如果能够增加一个延时执行任务的功能会非常完美。当前的speed功能是不是跟延时执行是一个道理? #294

Open
huguangzheng opened this issue Jun 5, 2024 · 4 comments

Comments

@huguangzheng
Copy link

No description provided.

@taojy123
Copy link
Owner

taojy123 commented Jun 6, 2024

是的 我理解应该当前的能力可以实现的。

@huguangzheng
Copy link
Author

是的 我理解应该当前的能力可以实现的。

请问下,当前master最新代码我看支持了onbeginp的功能。
我尝试拿下来自己打包,但是没有任何东西生成。
pyinstaller -F -w --add-data "./assets;assets" KeymouseGo.py --hidden-import PySide2.QtXml
307 INFO: PyInstaller: 6.7.0, contrib hooks: 2024.6
308 INFO: Python: 3.10.11
317 INFO: Platform: Windows-10-10.0.19045-SP0
318 INFO: wrote D:\software\KeymouseGo-6\KeymouseGo.spec
320 INFO: Extending PYTHONPATH with paths
['D:\software\KeymouseGo-6']
45 WARNING: qt_material must be imported after PySide or PyQt!
542 INFO: Appending 'datas' from .spec
545 INFO: checking Analysis
593 INFO: checking PYZ
627 INFO: checking PKG
653 INFO: Bootloader D:\Program Files\Python310\lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe
653 INFO: checking EXE
656 INFO: Rebuilding EXE-00.toc because KeymouseGo.exe missing
656 INFO: Building EXE from EXE-00.toc
656 INFO: Copying bootloader EXE to D:\software\KeymouseGo-6\dist\KeymouseGo.exe
659 INFO: Copying icon to EXE
662 INFO: Copying 0 resources to EXE
662 INFO: Embedding manifest in EXE
665 INFO: Appending PKG archive to EXE
697 INFO: Fixing EXE headers
928 INFO: Building EXE from EXE-00.toc completed successfully.
PS D:\software\KeymouseGo-6>

另外还有一个问题就是:
在extention中增加的模块,如果引入了其他的python库,似乎执行会直接报错。
比如导入了opencv的东西:
2024-06-06 15:37:24.993 | INFO | UIFunc:init:83 - assets root:C:\Users\H00830~1\AppData\Local\Temp_MEI567202\assets
2024-06-06 15:37:35.746 | INFO | UIFunc:OnBtrunButton:443 - Script start
2024-06-06 15:37:35.747 | INFO | UIFunc:get_script_path:353 - Script path: D:\software\KeymouseGo-5\scripts\auto_connect_vpn.txt
2024-06-06 15:37:35.747 | INFO | UIFunc:run:511 - auto_connect_vpn.txt running..
2024-06-06 15:37:35.752 | ERROR | UIFunc:run:527 - An error has been caught in function 'run', process 'MainProcess' (64124), thread 'Dummy-1' (63308):
Traceback (most recent call last):

File "UIFunc.py", line 527, in run

File "UIFunc.py", line 586, in getextension

File "", line 407, in _check_name_wrapper
File "", line 907, in load_module
File "", line 732, in load_module
File "", line 265, in _load_module_shim
File "", line 696, in _load
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed

File "D:\software\KeymouseGo-5\plugins\DelayExtension.py", line 5, in
import cv2

File "C:\Users\H00830~1\AppData\Local\Temp\embedded.5f_en_ag.zip\shibokensupport_feature_.py", line 142, in _import

ModuleNotFoundError: No module named 'cv2'
2024-06-06 15:37:35.756 | ERROR | UIFunc:run:568 - Run error: 'NoneType' object has no attribute 'onbeginp'
2024-06-06 15:43:50.622 | INFO | UIFunc:OnBtrunButton:443 - Script start

@Monomux
Copy link
Collaborator

Monomux commented Jun 6, 2024

我尝试拿下来自己打包,但是没有任何东西生成。

pyinstaller打包的程序默认在<源码目录>/dist

另外还有一个问题就是: 在extention中增加的模块,如果引入了其他的python库,似乎执行会直接报错。

这是目前程序用pyinstaller打包发行会遇到的问题,一旦打包完成,程序包含的模块就无法改变了。要添加额外的模块比较麻烦,一种相对简单的方法是下载源码再手动安装附加模块。比如你的例子里要保证打包的程序包含opencv库,就需要在安装步骤的第3第4步之间额外执行

pip3 install opencv

@huguangzheng
Copy link
Author

我尝试拿下来自己打包,但是没有任何东西生成。

pyinstaller打包的程序默认在<源码目录>/dist

另外还有一个问题就是: 在extention中增加的模块,如果引入了其他的python库,似乎执行会直接报错。

这是目前程序用pyinstaller打包发行会遇到的问题,一旦打包完成,程序包含的模块就无法改变了。要添加额外的模块比较麻烦,一种相对简单的方法是下载源码再手动安装附加模块。比如你的例子里要保证打包的程序包含opencv库,就需要在安装步骤的第3第4步之间额外执行

pip3 install opencv

谢谢。但是确实没有生成东西。一直都是空的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants