Third party libraries with HLAs

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?

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