Python-Ogre sampleframework issues


20-09-2008 23:52:25

I am a bit new to Python and game programming in general. I have experimented with and compared many python game engines and Python-Ogre seems to be the most promising, however, whenever I run the first tutorial and import the SampleFramework i get the following error within the file imported into the compiled SampleFramework:

File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\", line 35, in getPluginPath
raise ogre.Exception(0, "can't locate the 'plugins.cfg' file", "")
AttributeError: 'module' object has no attribute 'Exception'

Has anyone else ever experienced this? If so please give details on solving this problem.


P.S. im not sure if any of this makes sense... im still trying to grasp the vocabulary...


21-09-2008 01:24:18


I'm not sure where you got your tutorial, but most likely, the code has not been kept up to date or specially if the code was migrated from pyogre.

If you post, your tutorial code, I may be able to look at was is wrong. I have encountered the same problems.

Another good source of sample code is the \demo\ogre folder. It contains a lot of good examples that should run.

In the mean time I would like to tell about my efforts to create a tool to generate python stand alone code from a windows sort of environment.
The project is called wxOgre

The main thread is here:

The Block diagram below shows how all the pieces fit together:

In summary: is used to create XML files that store information about the scene
XML files are read into the wxOgre environment
XML files are stored to be later converted into stand alone applications is used to create stand alone applications. It takes XML and creates native python-ogre code.

wxPanel*.py are used to show data within wxOgre. this allow modularity

class*.py. are classes written in python used both by stand alone applications and wxOgre.

There are demo*.py files that show the basic structure of python.

This is a work in progress and the latest version is rev35.

Anyway, I would be happy to answer any question you may have.



21-09-2008 01:26:08

First do the demos work - ie
If so then at least everything is installed correctly etc.

Try running your tutorial program from the demos/ogre directory and see if it works there as you possibly don't have the plugins.cfg in the directory you are using for the tutorial



21-09-2008 03:30:06

Your GUI add on seems pretty cool. I looked at some of the samples and it seems very promising and easy to implement. I'll check it out after I get all of the basic stuff working correctly.

Also here is the basic code for the tutorial series that I am using. Hopefully you can determine if its obsolete or not

import ogre.renderer.OGRE as ogre
import SampleFramework as sf

class TutorialApplication(sf.Application):

def _createScene(self):

if __name__ == '__main__':
ta = TutorialApplication()

The code from the module that is erroring is right here:

def getPluginPath():
"""Return the absolute path to a valid plugins.cfg file."""
import sys
import os
import os.path

paths = [os.path.join(os.getcwd(), 'plugins.cfg'),
os.path.join(os.getcwd(), '..','plugins.cfg'),
for path in paths:
if os.path.exists(path):
return path

"** Warning: Unable to locate a suitable plugins.cfg file.\n"
"** Warning: Please check your ogre installation and copy a\n"
"** Warning: working plugins.cfg file to the current directory.\n\n")
raise ogre.Exception(0, "can't locate the 'plugins.cfg' file", "")

the raise
ogre.Exception(0, "can't locate the 'plugins.cfg' file", "")
is the one erroring

And to andy, the smoke sample did work correctly, so I am still in the dark as to why this is happening lol.

Thx to both of you!


21-09-2008 03:52:22

What directory are you in when you run your tutorial code?


21-09-2008 04:13:18

Problem solved!!! It was a pretty noob error... The directory that I put the file in simply did not have the resources that were needed to run the tutorial.

Sorry to waste your time lol but massive thx anyway!