Unable to import Caelum, ogreforests or Plib

Garrian

04-06-2011 16:31:31

Hi there

Im very new at using Python-Ogre and I am having a few issues when importing running a Ogre editor that I have made using someone elses source code.

The problem I am having is it import caelum, ogreforests and plib modules.

import ogre.addons.caelum as caelum
import ogre.addons.plib as plib
import ogre.addons.ogreforests as forests



Traceback (most recent call last):
File "mapeditor.py", line 12, in <module>
import ogre.addons.caelum as caelum
File "C:\Python27\lib\site-packages\ogre\addons\caelum\__init__.py", line 1, i
n <module>
from _caelum_ import *
ImportError: DLL load failed: The specified module could not be found.

Any help would be awesome as I am starting to eye up the keyboard as a victim!

Cheers

Mohican

04-06-2011 16:36:41

What system are you using, and which Pytohn-Ogre SDK?

You may have downloaded a partial SDK.
Check that you have the file caelum.pyd for instance.

Garrian

04-06-2011 16:46:10

I have checked and

C:\Python27\Lib\site-packages\ogre\addons\caelum\_caelum_.pyd
C:\Python27\Lib\site-packages\ogre\addons\ogreforests\_ogreforests_.pyd
C:\Python27\Lib\site-packages\ogre\addons\plib\_plib_.pyd


these are all definately there.

My version is 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
Python-Ogre Version 1.7.1
wxpython version wxPython2.8-win32-unicode-2.8.12.0-py27.exe

Mohican

04-06-2011 18:31:47

Hmmm.... you probably need to use CPython, because Python-Ogre was compiled with the CPython SDK.
Compiled C code is not cross-compatible between the various python versions.

dermont

04-06-2011 19:45:44

I have checked and

C:\Python27\Lib\site-packages\ogre\addons\caelum\_caelum_.pyd
C:\Python27\Lib\site-packages\ogre\addons\ogreforests\_ogreforests_.pyd
C:\Python27\Lib\site-packages\ogre\addons\plib\_plib_.pyd


these are all definately there.

My version is 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
Python-Ogre Version 1.7.1
wxpython version wxPython2.8-win32-unicode-2.8.12.0-py27.exe


AFAIK Python-Ogre Version 1.7.1 is for python2.6 and you also need import ogre.renderer.OGRE as ogre prior to loading an addon so the correct DLL's are loaded.

Garrian

05-06-2011 03:50:59

Yea so far I have removed all versions of Python and Python Ogre, have installed Python 2.6 and Python-Ogre 1.7.1, have installed wx 32bit for python 2.6 and I am still getting the same error. The start of my code is as follows:

import wx
import time
import ogre.renderer.OGRE as ogre
from OgreWindowWx import *
import ogre.addons.ogreforests as forests
import ogre.addons.plib as plib
#import ogre.sound.OgreAL as OgreAL
import ogre.addons.caelum as caelum

But for some reason it just wont see the python the addons folder!

Garrian

05-06-2011 04:51:03

If I run python and then try and import the function manually this is what happens.

>>> import ogre.addons.caelum as caelum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python26\lib\site-packages\ogre\addons\caelum\__init__.py", line 1, i
n <module>
from _caelum_ import *
ImportError: No module named _caelum_
>>>

Garrian

05-06-2011 05:04:38

I also thought id try and run some of the other demos and I get a similar error

D:\Python-Ogre\demos\ogre>python Demo_OgreCollision02.py
Traceback (most recent call last):
File "Demo_OgreCollision02.py", line 13, in <module>
import ogre.physics.ODE as ode
File "D:\Python26\lib\site-packages\ogre\physics\ODE\__init__.py", line 1, in
<module>
from _ode_ import *
ImportError: No module named _ode_



How ever it seems most of the demos in the Python-Ogre/demos/ogre folder work fine

dermont

05-06-2011 05:28:47

If I run python and then try and import the function manually this is what happens.

>>> import ogre.addons.caelum as caelum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python26\lib\site-packages\ogre\addons\caelum\__init__.py", line 1, i
n <module>
from _caelum_ import *
ImportError: No module named _caelum_
>>>

Have you downloaded the caelum-1.7.1-r1113.7z addon, unzipped and re-run setup.py install?
http://sourceforge.net/projects/python- ... est/1.7.1/

What message do you get if you cd to D:\Python26\lib\site-packages\ogre\addons\caelum and import caelum. From what you have done above you should be getting a DLL load fail since you haven't loaded ogre and it's associated DLLs.

Garrian

05-06-2011 05:42:29

sorry for being a noob but am I supposed to associate the dll's?

Here is what I have in the caelum folder.

D:\Python26\Lib\site-packages\ogre\addons\caelum>dir
Volume in drive D is Project
Volume Serial Number is FCF5-F7E4

Directory of D:\Python26\Lib\site-packages\ogre\addons\caelum

06/05/2011 02:59 PM <DIR> .
06/05/2011 02:59 PM <DIR> ..
09/10/2009 10:54 PM 24 __init__.py
06/05/2011 02:27 PM 186 __init__.pyc
2 File(s) 210 bytes
2 Dir(s) 157,013,356,544 bytes free

D:\Python26\Lib\site-packages\ogre\addons\caelum>python __init__.py
Traceback (most recent call last):
File "__init__.py", line 1, in <module>
from _caelum_ import *
ImportError: No module named _caelum_

dermont

05-06-2011 05:50:58

sorry for being a noob but am I supposed to associate the dll's?
As already mentioned you need to import the ogre module first, this doesn't explain the error you are encountering.
>>>import ogre.renderer.OGRE as ogre
>>>import ogre.addons.caelum as caelum

Have you installed the addon and tried to import directly from addon dir:

cd D:\Python26\lib\site-packages\ogre\addons\caelum
>>>import ogre.addons.caelum as caelum

Garrian

05-06-2011 05:58:14

Ok I have found out the problem and due to my stupidness I wasnt rebuilding the addon files from the package2.6 after loading in caelum and ogreforest downlaods you gave me which were awesome thanks!

How ever is there one for plib?

dermont

05-06-2011 15:30:55

Ok I have found out the problem and due to my stupidness I wasnt rebuilding the addon files from the package2.6 after loading in caelum and ogreforest downlaods you gave me which were awesome thanks!

How ever is there one for plib?

There doesn't appear to be a module for plib, if it's networking you are interested in maybe you could try the raknet module. There is also a thread here for an updated version of python-ogre, maybe you try asking for the plib module to be included there.

viewtopic.php?f=3&t=14367