NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.28k stars 13.53k forks source link

Blender fails to load the ucupaint add-on due to missing 'distutils' python package. #327664

Open nojusr opened 1 month ago

nojusr commented 1 month ago

Describe the bug

Blender fails to load the ucupaint addon, seemingly due to a missing 'distutils' python package.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add blender to your config or nix-shell -p blender.
  2. Download the latest version of ucupaint (here)
  3. Install the plugin via standard means
  4. Enable (or attempt to enable) the ucupaint plugin, found within Edit->Preferences->Add-ons
  5. Observe the error

Expected behavior

The plugin should load and display it's menu on the right side of the screen as pictured in ucupaint's repository.

Additional context

Add any other context about the problem here.

Attempting to use the workaround mentioned in this issue resulted in the same error. Console output upon trying to load the ucupaint plugin in all cases is as follows:

[nojus@koronis:~]$ nix-shell -p python3Packages.distlib --run blender
this path will be fetched (0.22 MiB download, 1.30 MiB unpacked):
  /nix/store/287fcmw9m2f1i5m14x9035jgvs323gih-python3.12-distlib-0.3.8
copying path '/nix/store/287fcmw9m2f1i5m14x9035jgvs323gih-python3.12-distlib-0.3.8' from 'https://cache.nixos.org'...
Read prefs: "/home/nojus/.config/blender/4.1/config/userpref.blend"
Read blend: "/home/nojus/misc/12th_md_custom_helms/kelp_v8/kelp_v8.blend"
Traceback (most recent call last):
  File "/nix/store/p8kii2a4sbzxl9cy26rv4prvyviqplm2-blender-4.1.1/share/blender/4.1/scripts/modules/addon_utils.py", line 376, in enable
    mod = importlib.import_module(module_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/z7xxy35k7620hs6fn6la5fg2lgklv72l-python3-3.12.4/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/nojus/.config/blender/4.1/scripts/addons/ucupaint/__init__.py", line 49, in <module>
    from . import image_ops, common, bake_common, modifier_common, lib, ui, subtree, transition_common, input_outputs, node_arrangements, node_connections, preferences
  File "/home/nojus/.config/blender/4.1/scripts/addons/ucupaint/ui.py", line 7, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[nojus@koronis:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.12, NixOS, 24.11 (Vicuna), 24.11.20240712.7e7c39e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos, nixos-unstable"`
 - nixpkgs: `/nix/store/qmh8bas1qni03drm0lnjas2azh7h87cn-source`

Add a :+1: reaction to issues you find important.

nojusr commented 1 month ago

Crap, I forgot to ping maintainers.

@cillianderoiste @veprbl

veprbl commented 1 month ago

What is distlib? Isn't distutils shipped with setuptools. (It's deprecated, so it will be broken eventually)

nojusr commented 1 month ago

Ah. i failed to notice that the console output was from one of my attempts to find the right package that would remedy the issue. I tried the method used above with:

Basically anything that looked right when searching for distutils in nixpkgs