drmichaeldouglass / MedBlend

A Medical Visualisation Add-On for Blender
MIT License
67 stars 4 forks source link

Cannot activate add-on v.1.02 in Blender 4.0.2 #11

Open gauvinalexandre opened 8 months ago

gauvinalexandre commented 8 months ago

After installing the v.1.0.2 Add-on in Blender 4.0.2, I cannot activate it in Blender because it gives me the following error:

  File "/home/algo/software/blender-4.0.2-linux-x64/4.0/scripts/modules/addon_utils.py", line 364, in enable
    mod = importlib.import_module(module_name)
  File "/home/algo/software/blender-4.0.2-linux-x64/4.0/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'MedBlend-1'
drmichaeldouglass commented 8 months ago

I think that means that the zip file containing the add-on is not called "MedBlend". It is probably called "MedBlend-1.zip". Renaming the zip file and reinstalling the addon should fix it

gauvinalexandre commented 8 months ago

Ok. I could go further by unzipping the add-on, renaming the root directory to MedBlend, then zipping it back before installing it in Blender using the normal process. However, when I try to activate it, an error occurs saying Blender cannot fin the pydicom module.

Traceback (most recent call last):
  File "/home/algo/software/blender-4.0.2-linux-x64/4.0/scripts/modules/addon_utils.py", line 364, in enable
    mod = importlib.import_module(module_name)
  File "/home/algo/software/blender-4.0.2-linux-x64/4.0/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/algo/.config/blender/4.0/scripts/addons/MedBlend/__init__.py", line 54, in <module>
    from .dicom_util import (
  File "/home/algo/.config/blender/4.0/scripts/addons/MedBlend/dicom_util.py", line 4, in <module>
    import pydicom
ModuleNotFoundError: No module named 'pydicom'

So it seems the dependency installation script doesn't do its job. My OS is Ubuntu 23.10.

Turbomichi commented 8 months ago

I got the same issue. No module named 'pydicom'.

Blender: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727, type: release build date: 2023-12-05, 13:01:12 platform: 'Windows-10-10.0.22631-SP0'

Turbomichi commented 8 months ago

After installing 'pydicom' manually and pressing the 'Install Dependencies' button Blender just tilts and turns grey.

drmichaeldouglass commented 8 months ago

MedBlend also needs these modules to run properly:

numpy==1.23.5 pydicom==2.3.1 platipy==0.7.1 SimpleITK==2.3.1

lethanner commented 6 months ago

If you are getting pydicom "not found" error when activating this addon, use this solution that worked for me:

  1. Locate to your Blender installation directory (in my case, this is D:\Software\Blender Foundation\Blender 4.1\)
  2. In this directory, find an embedded Python interpreter. In my case, this is located at <blender dir>\4.1\python\bin.
  3. When you found a directory with Blender's internal Python interpreter, open command line in this directory. In command line, print python.exe and press Enter. The Blender's Python interpreter will be launched.
  4. Print import pip and press Enter.
  5. Print pip.main(['install', 'pydicom', '--user']) and press Enter. Wait for installation.
  6. When installed, print exit() and press Enter again. Close command line.
  7. Restart Blender and try to activate addon again.

When successfully activated, locate to Medical tab and press Install dependencies to download all remaining dependencies. Be sure that your Blender will freeze while installing dependencies - to show installation progress, toggle Blender's system console before running installation.