# How to automatically get a Add-on folder's path regardless of OS?

In Blender, is there a command to query what's the current path to the Add-on folder - regardless of what system I'm using?

Ah, got it.

bpy.utils.user_resource('SCRIPTS', "addons")


Also see the wiki.

• Note, there can be multiple addon's directories (3 infact) UsersHome/UserPrefs/BlenderDefault. The example you give will only give the user's home directory addon path, which might not even exist. Dec 12, 2014 at 14:22
• Oh, good to know. I guess they're listed here: blender.org/manual/installing_blender/directorylayout.html Dec 12, 2014 at 14:24

If you want to know the directory of the currently-executing addon, try this:

import os

script_file = os.path.realpath(__file__)
directory = os.path.dirname(script_file)


This is especially useful if your addon is a Python package, because it tells you which is the relevant subdirectory.

Blender addon utils module can fetch the path of any given addon name if installed.

#iterate through all the addon name installed
#if The Addon Name exists then:
#.__file__ will give away the file path where it is installed
#We are printing the file path in console
#If the given name does not exist it will pass

import bpy