turn multiple scripts into addon I have multiple scripts that i would like to turn into an addon. I already have everything it needs, but i when i click the button to enable the addon in the user preferences it says:

  bpy.utils.register_class(SCAPANEL)
  ValueError: register_class(...): already registered as a subclass


I imported every other file I need via from .example import example and put these files in one folder. I even looked up other blender addons, but that didn't help either.

Edit:

def register():
   bpy.utils.register_class(SCAPANEL)
   bpy.utils.register_class(SCA)
   bpy.utils.register_class(Skin)
   bpy.utils.register_class(removeDoubles)
   bpy.utils.register_class(thin)
   bpy.types.Scene.Tree = bpy.props.StringProperty()
   bpy.utils.register_class(particlesystem)
   bpy.types.Scene.Growth_limitation = bpy.props.BoolProperty()
   bpy.types.Scene.limiter = bpy.props.StringProperty()


def unregister():
   bpy.utils.unregister_class(SCAPANEL)
   bpy.utils.unregister_class(SCA)
   bpy.utils.unregister_class(Skin)
   bpy.utils.unregister_class(removeDoubles)
   bpy.utils.unregister_class(thin)
   bpy.utils.unregister_class(particlesystem)
   del bpy.types.Object.Tree
   del bpy.types.Object.Growth_limitation
   del bpy.types.Object.limiter


register()


These are only the register and unregister functions. I noticed that my panels sitll shows up, even though the box is not ticked. When I try to execute my script it says, that it cannot perform a relative import.
Enabling an addon calls register
The issue in new code posted is the lack of
if __name__ == &quot;__main__&quot;:
     register() 

(pretty much ubiquitous in all blender addons and UI code etc etc, or for python command line scripts) Without this conditional register() will be run on import (Worth noting on import __name__ is the module name, ie not matching &quot;__main__&quot;).
When an addon is enabled it is imported and calls its module.register() Henceforth your code is registering a second time and throws the error on the first class registered in register method.
The conditional code is there so scripts can be tested in the text editor.
Note: another thing to look for:  for registered classes the bl_idname property is how they are known to blender.