admin管理员组文章数量:1026989
Running Python 3.13 (with venv in Windows 11) with PEAK's can adapter and trying to achieve the following:
- initialize a connection to PEAK's adapter
- send raw-can messages with cob-id 0x82 (data bytes are non-relevant)
- wait for 1s
- send few UDS requests, handle the response, exc.
- uninitialize the connection
- quit
Now, the pickle is that when i run the script from cmd it all works fine (I can tell the adapter is sending the messages from another adapter in the same bus), but when i pack the script with pyinstaller to an .exe it partly works; the first messages are not sent, but the uds requests and responses work like a charm. One thing to note is that the raw-can messages use functions from different class as the uds messages (in which the initialization function is belonging to).
I'm importing and using the manufacturer provided code for all the function calls handling the DLL-calls (PCAN_UDS_2013.py, PCAN_ISO_TP_2016.py, PCANBasic.py for those familiar) and all the dll imports seem to complete quite fine when using pyinstaller.
All in all there is only one visible "error"; the failing part of the code "write"-function is returning "Non-initialized"-state, which I could understand if it would function the same way when trying to run it from the command line.
Any pointers, where to look next/how to get more information if some linkage / import / etc. fails during pyinstaller use?
Originally the script was longer with threading and other sort of shenanigans(to minimize the concurrent use of function calls), but I made a minimal version with just few for loops for sending the messages and it resulted with the same type of behavior.
Tried also to minimize namespace pollution, to no avail.
Running Python 3.13 (with venv in Windows 11) with PEAK's can adapter and trying to achieve the following:
- initialize a connection to PEAK's adapter
- send raw-can messages with cob-id 0x82 (data bytes are non-relevant)
- wait for 1s
- send few UDS requests, handle the response, exc.
- uninitialize the connection
- quit
Now, the pickle is that when i run the script from cmd it all works fine (I can tell the adapter is sending the messages from another adapter in the same bus), but when i pack the script with pyinstaller to an .exe it partly works; the first messages are not sent, but the uds requests and responses work like a charm. One thing to note is that the raw-can messages use functions from different class as the uds messages (in which the initialization function is belonging to).
I'm importing and using the manufacturer provided code for all the function calls handling the DLL-calls (PCAN_UDS_2013.py, PCAN_ISO_TP_2016.py, PCANBasic.py for those familiar) and all the dll imports seem to complete quite fine when using pyinstaller.
All in all there is only one visible "error"; the failing part of the code "write"-function is returning "Non-initialized"-state, which I could understand if it would function the same way when trying to run it from the command line.
Any pointers, where to look next/how to get more information if some linkage / import / etc. fails during pyinstaller use?
Originally the script was longer with threading and other sort of shenanigans(to minimize the concurrent use of function calls), but I made a minimal version with just few for loops for sending the messages and it resulted with the same type of behavior.
Tried also to minimize namespace pollution, to no avail.
本文标签:
版权声明:本文标题:Python(3.13), Pyinstaller, DLLs, PEAK, venv: Part of script runs on cmd but not as .exe - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1740974369a1806505.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论