Page 1 of 1

No module named Blender!!

Posted: Fri Jan 14, 2011 2:33 am
by thru2trot
Hello all,

I purchased a book that I am trying to follow along with, however it is a bit dated. I know that Blender2.56 is built entirely on python3.1. Here is the script I am trying to run in the blender python console:

Code: Select all

import Blender
from Blender import Scene, Text3d, Window

hello = Text3d.New("HelloWorld")
hello.setText("Hello World")

scn = Scene.GetCurrent()
ob =

I don't know if this code is correct in terms of the syntax, however, I am getting this as an error:

Code: Select all

Traceback (most recent call last):
  File "", line 3, in <module>
ImportError: No module named Blender

location:<unknown location>:-1

Python script fail, look in the console for now...
in the user info column, which leads me to believe that either my PYTHONPATH or PATH is not accurate.

Any help on this would be greatly appreciated. I am very eager to start coding, however I know its good that I am going through this so I know what goes on under the hood!!

Best Regards,


Posted: Fri Jan 14, 2011 6:37 pm
by jesterKing
The Blender Python API has changed, there is indeed no Blender module anymore, nor any of the modules you try to import from it. See the new Blender Python API instead.

Also, in the text editor you can find script templates with examples of how to script in the new 2.5x series.


You're absolutely right jesterKing!!

Posted: Fri Jan 14, 2011 7:50 pm
by thru2trot
Hello Stiv,

I can't thank you much for your help and expertise. Well, in literally taking a stab
at building python2.56a from source using the instruction on these 2 very helpful links: ... untu/CMake ... eatorLinux

I gained a lot of valuable knowledge of what it goes on under the hood with Blender.
I basically followed both of these tutorials(Building Blender from source using Cmake,
and compile Blender using CMake with QTCreator on Linux) These were excellent tutorials:

Now for some simple questions, I did an update by goind to this directory:


then running

svn up

The Terminal outputs these jargons:

Fetching external item into 'release/scripts/addons'

blah, blah, blah

and then confirms that:

Updated external to revision 1399.
Updated to revision 34324.

I then go to cd ~/blender-build/cmake:

and then:

make -j3

it then spools out all percentages based on what it downloads and then finally:

Linking C static library ../../../../lib/libbf_rna.a

Scanning dependencies of target blender

Linking CXX executable ../../bin/blender

All I need to know now is if I have to do anything else in Qt, being that Qt will rebuild and run
blender with this updated svn source?? Is there a script or beta number, or file that confirms that
it was updated, because when I run Blender, blender launches with no version#??

Thanks so much for your help again,


DDDoooppppeee!!It's right in the Terminal print out!!

Posted: Fri Jan 14, 2011 8:21 pm
by thru2trot
OHHH Gosh,

I think I see it,

Updated external to revision 1399
Updated to revision 34324..

I guess it would be nice to see it logged in a file, I'm sure it exists.

Best Regards,


P.S. I also saw it on the blender splash screen picture right after I run it in QT.

Best Regards,


Re: DDDoooppppeee!!It's right in the Terminal print out!!

Posted: Fri Jan 14, 2011 8:49 pm
by jesterKing
thru2trot wrote:P.S. I also saw it on the blender splash screen picture
You can also find the information through the BPy API:

Code: Select all