Skip to content

Only import runner from edge_impulse_linux - #36

Open
AIWintermuteAI wants to merge 1 commit into
masterfrom
runner-import-only
Open

Only import runner from edge_impulse_linux#36
AIWintermuteAI wants to merge 1 commit into
masterfrom
runner-import-only

Conversation

@AIWintermuteAI

@AIWintermuteAI AIWintermuteAI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

As a side effect of how package init files is done now, a missing PortAudio/OpenCV crashes the whole package import, even for user who did not need audio/image.

With this change users who only need ImpulseRunner can now import edge_impulse_linux without having pyaudio or opencv-python installed. This removes awkward comments like this

# Edge Impulse Linux SDK + pyaudio. The SDK imports `pyaudio` at load time
# (even for image models), and `portaudio19-dev` above is needed to build it.

NB: edge_impulse_linux.audio and edge_impulse_linux.image are no longer auto-loaded as attributes of the package. Code that relied on import edge_impulse_linux; edge_impulse_linux.audio.AudioImpulseRunner would break. However, all the examples use explicit submodule imports (from edge_impulse_linux.audio import ..., from edge_impulse_linux.image import ...), which still works, as Python imports the submodule on demand. So the examples are unaffected.

@AIWintermuteAI AIWintermuteAI self-assigned this Jul 31, 2026
@AIWintermuteAI

Copy link
Copy Markdown
Contributor Author

Ideally we also want to re-write the install to be modular, e.g.

pip install edge_impulse_linux[all]
pip install edge_impulse_linux[image]
pip install edge_impulse_linux[audio]
pip install edge_impulse_linux[minimal]

@AIWintermuteAI AIWintermuteAI added the enhancement New feature or request label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant