# How to get the addons path using python?

How to get the value of this variable ?

An add-on is just a regular python module so there are multiple ways to get the actual path.

You can use addon_utils, a module for addon management that comes with blender to filter the add-on and get the path:

import addon_utils
print(mod.bl_info.get("name"))
print(mod.__file__)


Or you can iterate through all enabled addons and use sys.modules dict:

import bpy
import sys

context = bpy.context

mod = sys.modules[mod_name]
print(mod.__file__)

• Do you happen to know how to get the path to the adonns, knowing only the N-panel ? !image
– jora
Mar 16 at 23:46

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