# Third party libraries with HLAs

**URL:** https://discuss.saleae.com/t/third-party-libraries-with-hlas/595
**Category:** Extensions
**Created:** [June 19, 2020, 5:11pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595 "2020-06-19T17:11:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Scarzer](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/scarzer/32/472_2.png) [@Scarzer](https://discuss.saleae.com/u/Scarzer)
#### Post date: [June 19, 2020, 5:11pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/1 "2020-06-19T17:11:03Z")

</div>

First and foremost, thank you for all the hard work that’s being put into Logic 2. It’s become a regular part of my daily work flow.

I wanted to analyze some protobufs in my HLA, but quickly hit upon the issue that I couldn’t import the dependencies required. After going about several methods of adding the packages, I only got to where I wanted after unpacking the AppImage… I doubt that’s a recommended way of going about things.

What is the best way to add third party modules to a new HLAs? Is that just not yet supported?

---

<div class="post-metadata">

### Author: ![john](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@john](https://discuss.saleae.com/u/john)
#### Post date: [June 19, 2020, 7:11pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/2 "2020-06-19T19:11:40Z")

</div>

Hi Scarzer,

Thank you for the kind words! We don’t currently have a supported way of installing Python dependencies. This is made harder on Linux, as you discovered, by the fact that the AppImage installs to a separate temporary directory each run.

For an easier workaround in the meantime, you can modify the sys.path in your extension file to include the directory that you installed the Python package to:

```
import sys
MY_ADDITIONAL_PACKAGES_PATH = '/packages/install/location'
if MY_ADDITIONAL_PACKAGES_PATH not in sys.path:
    sys.path.append(MY_ADDITIONAL_PACKAGES_PATH)

import protobuf

```

Note that ‘/packages/install/location’ is the directory where you installed the packages, not the path to the package itself. So in the protobuf case, it should contain a folder with the name ‘protobuf’ containing the package’s Python files.

An extension that uses the package in this way will unfortunately not work if added to the marketplace at the moment. We’ll likely support installing package dependencies at the extension level either via a standard setup.py or requirements.txt in the future.

Best,  
John

---

<div class="post-metadata">

### Author: ![jonathan.gjertsen](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jonathan.gjertsen](https://discuss.saleae.com/u/jonathan.gjertsen)
#### Post date: [July 22, 2020, 8:40pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/3 "2020-07-22T20:40:58Z")

</div>

> An extension that uses the package in this way will unfortunately not work if added to the marketplace at the moment.

Would it work if the user happened to have the packages installed in that location though? That would provide a workaround - just add an instruction to the description/README to make sure the packages are available in that location. Or are you saying that the import would somehow be blocked if the extension were installed through the marketplace?

---

<div class="post-metadata">

### Author: ![john](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@john](https://discuss.saleae.com/u/john)
#### Post date: [July 23, 2020, 6:52pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/4 "2020-07-23T18:52:09Z")

</div>

It should work if the user manually installs the package to that location, though coming up with an install location that will work on Windows and macOS/Linux will be challenging. Extensions installed via the marketplace are configured in the same way as local extensions at the Python level so there shouldn’t be any differences there.

---

<div class="post-metadata">

### Author: ![bruff](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@bruff](https://discuss.saleae.com/u/bruff)
#### Post date: [July 29, 2020, 4:08pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/5 "2020-07-29T16:08:26Z")

</div>

Could the extension.json provide a standard mechanism to specify system path additions specific to the extension? Which would show up in the cfg dialogs?

---

<div class="post-metadata">

### Author: ![jonathan.gjertsen](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jonathan.gjertsen](https://discuss.saleae.com/u/jonathan.gjertsen)
#### Post date: [September 22, 2020, 7:22am UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/6 "2020-09-22T07:22:45Z")

</div>

I have posted a feature request here [https://ideas.saleae.com/b/feature-requests/hla-support-python-dependencies](https://ideas.saleae.com/b/feature-requests/hla-support-python-dependencies)

---

<div class="post-metadata">

### Author: ![Ryanf55](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@Ryanf55](https://discuss.saleae.com/u/Ryanf55)
#### Post date: [January 9, 2026, 6:08pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/7 "2026-01-09T18:08:56Z")

</div>

I needed to use pymavlink for the MAVLink extension I wrote. Here is a little tidbit that automatically imports packages from the user’s site packages (where it would appear if a user ran `python3 -m pip install pymavlink`)

```auto
import sys
import site

user_site = site.getusersitepackages()

if user_site not in sys.path:

    sys.path.append(user_site)

from pymavlink import mavutil

```

This should work on Ubuntu 22. With Ubuntu 24, my plan is to allow the analyzer to have a `StringSetting` that a user can put in the path to their virtual environment.

---

<div class="post-metadata">

### Author: ![TDHolmes](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@TDHolmes](https://discuss.saleae.com/u/TDHolmes)
#### Post date: [February 27, 2026, 6:12pm UTC](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/8 "2026-02-27T18:12:24Z")

</div>

Here’s my full workaround at the top of my HLA source:

```python
import os, subprocess, shlex, sys

# --- hack to work around not being able to install 3rd party plugins ---
# https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/7

VENV_DIR = os.path.join(os.path.dirname( __file__ ), ".saleae_venv")

PACKAGE_NOT_INSTALLED_MESSAGE = f"""ERROR: Saleae venv required for using MY_THIRD_PARTY_LIB.
Please run:
uv venv --clear --python {sys.version_info.major}.{sys.version_info.minor} {VENV_DIR}
source {VENV_DIR}/bin/activate
uv pip install MY_THIRD_PARTY_LIB
deactivate
"""

if not os.path.exists(VENV_DIR):
    print(PACKAGE_NOT_INSTALLED_MESSAGE)
    raise EnvironmentError(PACKAGE_NOT_INSTALLED_MESSAGE)

try:
    # check=False because these calls "fail" when not in the venv, but they still produce the right output...
    base_dir = subprocess.run(shlex.split(f"{VENV_DIR}/bin/python -m site --user-base"), check=False, encoding="utf-8", capture_output=True).stdout.strip()
    path_to_add = subprocess.run(shlex.split(f"{VENV_DIR}/bin/python -m site --user-site"), check=False, encoding="utf-8", capture_output=True).stdout.strip()

    path_to_add = path_to_add.replace(base_dir, VENV_DIR)
    print(f"Adding venv {path_to_add}")
    sys.path.insert(0, path_to_add)
except Exception as e:
    print(f"Hit {e} while trying to figure out what path to add for the venv")
    raise e

try:
    import MY_THIRD_PARTY_LIB
except ImportError as e:
    print(PACKAGE_NOT_INSTALLED_MESSAGE)
    raise EnvironmentError(PACKAGE_NOT_INSTALLED_MESSAGE)

# --- end 3rd party plugins hack ---

```
