Skip to content

Install python dependencies into mastodon-blender-view/libs/ folder, fixes #20#38

Draft
maarzt wants to merge 3 commits into
masterfrom
dependency-folder
Draft

Install python dependencies into mastodon-blender-view/libs/ folder, fixes #20#38
maarzt wants to merge 3 commits into
masterfrom
dependency-folder

Conversation

@maarzt
Copy link
Copy Markdown
Collaborator

@maarzt maarzt commented Jan 16, 2026

The python dependencies:

  • pandas,
  • bidict,
  • grpcio and grpcio-tools
    are now installed into folder that Blender choses for the "mastodon-blender-view". Into a subfolder called libs/.

This way to install dependencies is the preferred way for Blender Addons prior to Blender 4.2. see here

(Big thanks to @smlpt and @ChrisMzz, for reporting and investigating installation problems #20 and #36.
@ChrisMzz suggested that providing a proper target folder (flag --target) hen running pip install, fixes some installation problem. However the question what is a proper target folder remains. PR #36 now implements it's own rule of thumb for determining the target, which would probably work.)

The cleanest way to solve issue #20 would be to follow the Blender Manual, and deploy dependencies as wheels. see Blender Manual - Python Wheels
This would however drastically increase the effort for deploying the Mastodon Blender plugin. And only newer Blender version would be supported Blender > 4.2.

Blender installs the Mastodon Blender View addon into a specific folder.
On linux for example: ~/.config/blender/4.4/scripts/addons/mastodon_blender_view/

This commit changes the addon installation process to install it's dependencies
in a "libs" subfolder. For example:
 ~/.config/blender/4.4/scripts/addons/mastodon_blender_view/libs/
Previously the dependencies where installed into a globel folder.
Online discussions suggest that the new behavoir is a better practice.
It's still following Blenders best practice for addons, which would
deploy wheels with the addon.

Using this location hopefully solves two issues.
- "Portable Blender" is no longer required.
- Installation problems on some Windows machines would be fixed.
@maarzt
Copy link
Copy Markdown
Collaborator Author

maarzt commented Jan 16, 2026

The "Setup Mastodon Blender Addon" in Mastodon fails when running "test addon", resulting in an exception the "grpc" could not be imported. I guess the command for testing would need to be updated to change the sys.path, but I don't like that either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant