'module' object has no attribute 'ops' or 'context'

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 9
Joined: Mon Sep 12, 2011 7:58 pm

'module' object has no attribute 'ops' or 'context'

Post by noblunder » Sat Aug 11, 2012 12:37 am

i'm on ubuntu maverick (10.10), blender 2.49b, Python 2.6.5 -- a total noob to this

I have "import bpy" at the top of my script. Some bpy methods and properties work for me (e.g., "bpy.data.objects["Cube"]" )

but any code I execute with


leads to errors:

AttributeError: 'module' object has no attribute 'ops'
AttributeError: 'module' object has no attribute 'context'

What am I doing wrong??


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

Post by stiv » Sat Aug 11, 2012 3:49 am

You are trying to run new blender code on old blender.
You need the docs for the 2.49 API.

hint: import Blender as B is your friend.

hint: dir(some_module) will show you what is in it.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests