Addons files with a dot in the name can't get Ednabled #105679

Closed
opened 2023-03-12 00:46:06 +01:00 by Loïc DAUTRY · 2 comments

System Information
Operating system: Windows 11

Blender Version
Broken: 3.4
Worked: I don't know, it's been like this for years as far as I remember?

Short description of error

When installing an addon, may it be a single .py or a .zip file, such as addon.test.py, the user will get this error when trying to enable it:

Traceback (most recent call last):
  File "C:\AppInstall\Blender\stable\blender-3.4.1+stable.55485cb379f7\3.4\scripts\modules\addon_utils.py", line 333, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'addon'

Exact steps for others to reproduce the error
Create an addon (I used the text editor's addon template here), save it with any name with a dot such as addon.test.py.
In Edit > Preferences > Addons, install the addon, then try to enable it with the check mark.

This issue occurs for both .py and .zip addon files.

I guess the simple solution is that addon devs shouldn't provide addon files with dots in file names, but they do. In my personal experience, it isn't a rare occurrence. And in those case it's often the addon's version number with dots separators, sometimes auto-generated by the repository host.

Since non-tech-savy users never have the idea to simply rename the file, this lead to a bunch of addons which some user end up not using, thinking they are bugged out. (example)
Because of that, I thought maybe it would be better if the solution came from Blender directly?

Thanks!

**System Information** Operating system: Windows 11 **Blender Version** Broken: 3.4 Worked: I don't know, it's been like this for years as far as I remember? **Short description of error** When installing an addon, may it be a single .py or a .zip file, such as `addon.test.py`, the user will get this error when trying to enable it: ```python Traceback (most recent call last): File "C:\AppInstall\Blender\stable\blender-3.4.1+stable.55485cb379f7\3.4\scripts\modules\addon_utils.py", line 333, in enable mod = __import__(module_name) ModuleNotFoundError: No module named 'addon' ``` **Exact steps for others to reproduce the error** Create an addon (I used the text editor's addon template here), save it with any name with a dot such as `addon.test.py`. In Edit > Preferences > Addons, install the addon, then try to enable it with the check mark. This issue occurs for both .py and .zip addon files. I guess the simple solution is that addon devs shouldn't provide addon files with dots in file names, but they do. In my personal experience, it isn't a rare occurrence. And in those case it's often the addon's version number with dots separators, sometimes auto-generated by the repository host. Since non-tech-savy users never have the idea to simply rename the file, this lead to a bunch of addons which some user end up not using, thinking they are bugged out. ([example](https://github.com/wakatime/blender-wakatime/issues/1)) Because of that, I thought maybe it would be better if the solution came from Blender directly? Thanks!
Loïc DAUTRY added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-03-12 00:46:06 +01:00
Iliya Katushenock added the
Interest
Python API
label 2023-03-12 09:02:18 +01:00

Why is this a bug, it seems that it is clearly not correct to name the file with dots?

Why is this a bug, it seems that it is clearly not correct to name the file with dots?
Member

Hi, thanks for the report. This is not a bug.
Ref #83133 / #91509:

Dots separate python modules, hence they are not permitted in the directory/module names. See also patches D12071 and D9731 that were rejected for this reason.

Hi, thanks for the report. This is not a bug. Ref #83133 / #91509: >Dots separate python modules, hence they are not permitted in the directory/module names. See also patches [D12071](https://archive.blender.org/developer/D12071) and [D9731](https://archive.blender.org/developer/D9731) that were rejected for this reason.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-03-13 06:15:22 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105679
No description provided.