Python25 and Python-Ogre-0.9

inkomen1

03-03-2007 20:13:14

I am using Python25 and Python-Ogre-0.9

I have found a beginner scripting tutorial where you can create a scene from Ogre. But the problem is is that that the script is for Pyogre and not for the version that i use. That is why i got this error: No module named pyogre

Here underneath you see the code. I think that i must chance the first line to a code line for my installed version. I hope you know the right code...thx


from pyogre import ogre
import SampleFramework

class TutorialApplication(SampleFramework.Application):
def _createScene(self):
pass

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

Game_Ender

03-03-2007 20:46:40

This is the proper top line:


import Ogre as ogre


I do not know if that tutorial works with PythonOgre, but I do know that Python-Ogre has plenty of demos and you should be able to figure out the differences from them.

inkomen1

03-03-2007 21:02:14

I have looked in the demos.

It must be this: import Ogre as ogre...

But still he say this:No module named Ogre

inkomen1

03-03-2007 21:32:18

I have tryd alot of demos...and they say all the same error:No module named ogre

so it look likes that i maby istalled Python-Ogre wrong?...

andy

04-03-2007 03:33:48

Did you run python setup.py install from the Python-Ogre directory first?

Cheers

Andy

inkomen1

04-03-2007 11:38:13

Yes i have tried now but than i get an error to: no commands supplied

But what does that setup.py script than?

andy

04-03-2007 13:12:54

The command to run is:

python setup.py install

the "install" is part of the command line -- the error you mention is normally when you've just run "python setup.py" without any options.

Cheers

Andy

inkomen1

04-03-2007 15:13:01

Ok i have run the setup.py script succesfull

after that i tried to run a demo script. And i dont get the 'no module named Ogre' error anymore.

But now i get another error named like this: RuntimeError Could not load dynamic library../../plugins\rendersystem_Direct3D9.dll

andy

04-03-2007 22:38:08

So how are you running the demos ??

You should change dir to the demos directory and run the demo from there..
cd \Path-to-Python-Ogre\demos\ogre
python Demo_xxx.py

Also can you confirm you downloaded and installed the 0.9a release, NOT the snapshot (as the snapshot needs to be installed "over" the 0.9a release)

You can check that you have a plugins directory in your Python_ogre root and that it contains a set of dll files.. If not you had a problem extracting the package and should reinstall.

Cheers
Andy

Game_Ender

04-03-2007 23:11:32

The problem is probably the fact that none of the Demos ever work out of the box unless you have the proper directx dll installed. I just comment out the line that tries and load the Direct3D render system and they start up fine.

andy

04-03-2007 23:25:37

One can only hope that people using Windows have DirectX installed :) And we did put a link to it on the Wiki..

I guess this is something we'll check for when we build an "install" program..

Andy...

sebpotter

05-03-2007 12:57:37

Of course, almost any Windows user who regularly plays games is going to have the latest DirectX runtime installed.

Unfortunately, they're not very likely to have the versions that Ogre is looking for. Every single build system I've tested under Windows 2000, XP and 2003 has been missing the d3d dll version that Ogre is requesting. (Any of the runtime versions of d3dx9_30.dll, d3dx9_31.dll or d3dx9_32.dll .)

Fortunately, Microsoft provides a complete roll-up of all the runtime versions at http://www.microsoft.com/downloads/deta ... 4EF59DA050. Just download, install, and get on with development.

This could be more clearly documented for those new to Windows DLL versions, as the error is pretty frustrating for those who think they have installed the latest version of DirectX.

andy

05-03-2007 13:38:27

You are correct that this is a pain - especially as I tend to build the Python-Ogre binaries with a resonably recent DirectX.

We did put this in the [b]FAQ[/b], however I think the right longer term answer is to build a real install program and include the DirectX with it..

Cheers

Andy :)