TransWikia.com

How to get Blender's version number from Python?

Blender Asked on December 12, 2021

How do I go about programmatically getting the Blender version number?

Example: If I am running Blender 2.76, how would I get the version number from the python console?

2 Answers

Either open up a Text Editor area or just switch the Workspace to Scripting. Create a new document with the following contents and click run script or just press AltP:

import bpy

print(bpy.app.version_string)

In the main menu bar go to Window > Toggle System Console to display the requested blender version in Blender's Console Window.

Answered by Sourabh Manchale on December 12, 2021

bpy.app.version_string

Test using the python console:

>>> bpy.app.version_string
'2.83.2'

Usage within a script file:

import bpy
print(bpy.app.version_string)

which will print the actual version to the system console window:

2.83.2

bpy.app.version

If you're looking to compare version numbers, it's easier to do this using bpy.app.version which will always be a tuple of 3 ints, (major, minor, subversion), eg: (2, 76, 0)

So you can compare the version number with regular comparison.

if (2, 76, 0) > bpy.app.version:
    print("Your Blender version is too old!")

Answered by Greg on December 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP