-
Notifications
You must be signed in to change notification settings - Fork 485
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
No Connected Debug Probes when running executable built with PyInstaller #1694
Comments
I got the same issue, any ideas how to fix? |
Hi! Are you running the .exe in the same computer where the .py file works or is in another device? I think i had this error when I generated the exe and tried to use it in another device without installing the st-link driver. Also in this issue whe discussed about the exe generation, maybe it helps. |
same issue like you. do you find a way to fix it? |
Try to change the .spec file which is generated while you try to generate the .exe with pyinstaller. it works for my .exe with following .spec file: # -*- mode: python ; coding: utf-8 -*-
# Import necessary modules
import os
import pathlib
# Import specific utilities from PyInstaller
from PyInstaller.utils.hooks import get_package_paths, collect_entry_point
# Collect data and hidden imports for pyocd.probe and pyocd.rtos
datas_probe, hiddenimports_probe = collect_entry_point('pyocd.probe')
datas_rtos, hiddenimports_rtos = collect_entry_point('pyocd.rtos')
# Define the data paths for pyocd and pylink
datas = [
(get_package_paths('pyocd')[1], 'pyocd'),
(get_package_paths('pylink')[1], 'pylink')
]
# Right now we exclude cmsis_pack_manager, but could be needed in the future
# datas.append((get_package_paths('cmsis_pack_manager')[1], 'cmsis_pack_manager'))
excludes = ['cmsis_pack_manager']
# For the CLI version we don't want to include the gui command
excludes.append('tkinter')
# Define the analysis parameters
a = Analysis(
['main.py'],
pathex=['../'],
binaries=[],
datas= datas + datas_probe + datas_rtos,
hiddenimports=hiddenimports_probe + hiddenimports_rtos,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None,
noarchive=False
)
# Define the PYZ parameters
pyz = PYZ(a.pure,
a.zipped_data,
cipher=None)
# Define the EXE parameters
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='program_name',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['logo.ico'],
) then you have to create the .exe with: you can check it out at pyinstaller_doc |
thanks, it works for me. |
I am using pyocd version 0.36 with Python 3.11 and have used PyInstaller to build an executable of a script that uses pyocd. My script includes the use of ConnectHelper to open a session with an STM32 board. When I run the script (.py file), the node is found and everything works correctly. However, when I run the built executable, I encounter the following error:
Steps to Reproduce:
Expected Behavior:
The executable should successfully connect to the STM32 board, just as the script does when run directly with Python.
Actual Behavior:
The executable fails to find any connected debug probes and outputs the following error message:
Additional Information:
Questions:
Any help or guidance on resolving this issue would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: