Skip to content

How to use custom python dependencies #234

@RealTachyon

Description

@RealTachyon

This isn't a bug, but rather a question for how to properly use this extension.

I'm planning to write an addon that makes use of third party python libraries, as well as libraries that I've written myself.

Usually my working strategy is to create a new VSCode workspace with a pyproject.toml and then use poetry to set up a virtual environment.
In the pyproject.toml I would then set up dependencies like

[tool.poetry.dependencies]
attrs = "*"
rich = "*"
colorama = "*"

my_utils = { path = "../my_utils", develop = true }

The first three in this example would be third party dependencies.
The last one is a custom python library that lives in a sibling folder. For this one, it would be important to have it installed in development mode so that changes to it are recognized and used in higher level programs.

After installing the virtual environment with poetry, those dependencies would live in .venv\Lib\site-packages.

But this approach doesn't seem to be enough for this extension. How can I ensure that my addon has access to the required dependencies?

If possible, I would like to avoid installing the individual dependencies by hand in my Blender folder, since requirements can change, and I would like to keep the installation dynamic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions