Delicode / NI-mate-plugins

This repository holds the plugins for NI mate.
http://www.ni-mate.com
17 stars 7 forks source link

ImportError: No module named 'animation_delicode_ni_mate_tools_2' #7

Closed snovak closed 5 years ago

snovak commented 5 years ago

Hey there, I'm trying to install the addon for Blender 2.79, but on import I'm getting an error...

Modules Installed (animation_delicode_ni_mate_tools_2.79) from 'C:\Users\snovak\Downloads\animation_delicode_ni_mate_tools_2.79.py' into 'C:\Users\snovak\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons' Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender\2.79\2.79\scripts\modules\addon_utils.py", line 331, in enable mod = import(module_name) ImportError: No module named 'animation_delicode_ni_mate_tools_2'

I suspect that the "_2" is being appended by the installer trying to compensate for a previous installation? I see "animation_delicode_ni_mate_tools_2" no where in the script. However, I see "animation_delicode_ni_mate_tools" quite a bit.

Things I've tried so far....

...still no go.

snovak commented 5 years ago

.. so I've realized that the ..."_2" comes from the file name. But, even if I rename the py file animation_delicode_ni_matetools.2.79.py, with a "." instead of a "\", I still get the error

ImportError: No module named 'animation_delicode_ni_mate_tools'

SirDifferential commented 5 years ago

Fixed by removing the period in the filename. I didn't realize Blender cared what the files are called. Good catch!

EDIT: It seems this is a thing in Python, not Blender. You can't have a dot in a filename that's imported as a module.

snovak commented 5 years ago

Great! Fortunately this forced me to get moving with Blender 2.8, which is working. Thanks for the great software!