7
$\begingroup$

How can I get the the user preferences path from blender, on windows system the path is %appdata%\Blender Foundation\Blender\2.74\config I want to get this path from blender using python on any system.

$\endgroup$

1 Answer 1

11
$\begingroup$

Using: bpy.utils.resource_path('USER')

eg:

import os
import bpy

user_path = bpy.utils.resource_path('USER')
config_path = os.path.join(user_path, "config")
  • Or on Linux:
    /home/user_name/.config/blender/3.4
  • On ms-windows will return:
    C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\3.4

See: bpy.utils.resource_path api docs

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .