Python module problems on Ubuntu 10.04

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

messn
Posts: 3
Joined: Mon Jan 23, 2012 11:42 pm

Python module problems on Ubuntu 10.04

Postby messn » Tue Jan 24, 2012 12:18 am

Hi,

I have installed blender package on Ubuntu 10.04. I thought it would install python support for blender. Now i'm trying to import Blender modules from python interpreter but it can not find blender module.
This is the command i gave

Code: Select all

import Blender

and the output is:

Code: Select all

ImportError: No module named Blender

The same for 'import bpy'.
Using python2.6 and the output of

Code: Select all

blender -v

is

Code: Select all

Blender 2.49 (sub 2) Build


I have also downloaded blender-2.49b release and compiled with cmake. It created lots of *.o files in 'source/blender/python/api2_2x' folder but there are not any python modules in subfolders of build folder.

Now what should i do? A solution without any compilation process, only by using apt-get tools would be best. But an explanation of the way of compiling blender also to create python modules is good too.

Thank you!

stiv
Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Postby stiv » Tue Jan 24, 2012 3:36 am

. Now i'm trying to import Blender modules from python interpreter


Blender has its own embedded Python interpreter. These commands only work from inside Blender.

Old Blender (2.49 and older) needs a separate Python install. For Cmake, don't forget the 'make install' step and do run blender from the install dir, NOT the build dir.

Have you looked at the compilation instructions on the wiki?

messn
Posts: 3
Joined: Mon Jan 23, 2012 11:42 pm

Postby messn » Tue Jan 24, 2012 12:16 pm

Thank you stiv,

Now i understand the concept of scripting in blender. I'm going to try to code an Hello World script.

Best wishes!


Return to “Coding Blender”

Who is online

Users browsing this forum: No registered users and 2 guests