Create a folder dialog box for an addon (2.91)
This is how you get it to work
Import :

from bpy.props import PointerProperty


In your PT_Panel class:

ProjPath = context.scene.proj_path
row.prop(ProjPath, &quot;path&quot;, text='Project Path')


While registering:

classes = [project_path, PT_Panel]

def register():

    for cls in classes :
        bpy.utils.register_class(cls)
        bpy.types.Scene.proj_path= PointerProperty(type= project_path)


def unregister():

    for cls in classes :
        bpy.utils.unregister_class(cls)
        del bpy.types.Scene.proj_path


if __name__ == &quot;__main__&quot;:
    register()


If you want to save it permanently then use AddonPrefrences
And try to improve your naming skills :


Darkfall - https://www.youtube.com/watch?v=i12oOBI3E28
Red-K Production- https://www.youtube.com/watch?v=V1gU50MKulw