# Open user preferences directly into Add-ons tab

I'm using a script to show the User Preferences dialog:

bpy.ops.screen.userpref_show('INVOKE_DEFAULT')


But it shows the preferences "input" tab, and I want it to show the "Ad-ons" tab. I tried using this:

bpy.types.UserPreferences.active_section


It didn't work. How can I do that?

• Could you please provide more details how you actually open the preference window? Aug 22, 2021 at 10:21
• Ok I found the command bpy.ops.screen.userpref_show() Aug 22, 2021 at 10:26

bpy.context.preferences.active_section = 'ADDONS'

bpy.ops.screen.userpref_show()