I have created an addon written in multiple files.

if "bpy" in locals():
    import importlib
    from . import operator_add
    from . import operator_create

import bpy
import bmesh
import os
from operator_add import OBJECT_add

I got error message when trying to activate the add-on

AttributeError: module 'bpy' has no attribute 'props'

in the operator_add.py I have the class as follow:

class OBJECT_add(bpy.types.Operator):
    bl_idname = "myops.addthings"
    bl_label = "Add Base Mesh"
    bl_options = {'REGISTER', 'UNDO'}
    bl_description ="Add Base Mesh"
    #the error comes from this line:
    objectsToAdd = bpy.props.StringProperty()
    #this is trying to get the property from the UI draw() in the __init__.py

    def execute(self, context):
        add_myobject(self, context)
        return {'FINISHED'}

1 Answer 1



Here is a blender add-on that lets you create multi-file add-ons in blender easily. Just download the repository .zip and install the add-on. Next enable it. Now in the text editor click view > properties You will now see a couple new panels one named Addon Development then you will see a text box. Simply type in the name of your new add-on and click the button that pops up that says new addon multi-file Once this is done it will create a multi-file add-on automatically for you. Remember to click save all filesoften and also when you load blender back up and want to work on your add-on again just click the eyedrop tool and you will see a list of all the add-ons you are currently working on and click the one to load and it will. Hope this helps :)

Also in operator_add.py do you have import bpy? Maybe thats the reason?

  • $\begingroup$ Exactly what I searched for... last summer. But I will try it out for my addon :-) thanks $\endgroup$
    – M. Matz
    Jan 26, 2020 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.