Linux Problem : dynamic module does not define init function

fuinelen_

23-01-2008 12:55:21

I'm somewhat experienced with Ogre, but relatively new to Python, so bear with me if this is a stupid question. I installed python-ogre according to the Wiki, everything seemed to work fine, the C++ Ogre demos run fine.
When I try to run the python-ogre demos though, I get :


python Demo_Basic.py
Traceback (most recent call last):
File "Demo_Basic.py", line 19, in <module>
import ogre.renderer.OGRE as ogre
File "/home/sammy/OgreDev/pyOgre/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/__init__.py", line 10, in <module>
from _ogre_ import *
ImportError: dynamic module does not define init function (init_ogre_)


I checked the file. All there is is a comment #keep me

There is a .pyc version of it though.

any ideas?

andy

23-01-2008 15:01:14

Can you do an :
ls /home/sammy/OgreDev/pyOgre/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/
And see if there is an _ogre_.pyd file (I don't understand where your '#keep me' is coming from)

also do a:
cd /home/sammy/OgreDev/pyOgre/
python python-ogre/BuildModule.py -g -c ogre
python python-ogre/BuildModule.py -b install
And confirm that everything works

Andy

fuinelen_

23-01-2008 17:05:20

My bad about the "#keep me". I was looking at root/usr/lib/python2.5/site-package/ogre/_init_.py and not in renderer/OGRE

There is no _ogre_.pyd though.

those are the files present in root/usr/lib/python2.5/site-package/ogre/renderer/OGRE :

__init__.py
__init__.pyc
named_tuple.py
named_tuple.pyc
_ogre_exceptions_.py
_ogre_exceptions_.pyc
_ogre_.so
sf_OIS.py
sf_OIS.pyc
sf_utils.py
sf_utils.pyc

The first command failed

sammy@cosmic-bandito:~/OgreDev/pyOgre$ python python-ogre/BuildModule.py -g -c ogre
PythonOgre.BuildModule: INFO Building Source code for ogre
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Compiling Source code for ogre


the second one too, but I guess it was bound to if the first one failed

sammy@cosmic-bandito:~/OgreDev/pyOgre$ python python-ogre/BuildModule.py -b insttall
PythonOgre.BuildModule: ERROR Module specificed was not found (insttall is not in environment.py)


thanks for your quick reply by the way :)

EDIT: just came back from work. I deleted everything, and I'm starting from scratch. Maybe this time it will work ...

fuinelen_

24-01-2008 12:28:55

redid everything from scratch, same error as before.
I took a look at log.out and found this error :


RuntimeError: include directory("/home/sammy/OgreDev/PyOgre/root/usr/include/boost-1_34_1") does not exist!


I checked, and the directory was called /home/sammy/OgreDev/PyOgre/root/usr/include/boost-1_34

I copied it and renamed the copy accordingly, and now
/BuildModule.py -g -c ogre
does something. I'll tell you if it worked when (if) it finishes :)

andy

25-01-2008 01:33:26

I think you should delete everything and start from scratch :(, following the directions [b]here[/b] as it seems like you have a 'strange' build going on..

There is no reason for the boost directory name issue that I can think of unless you have mixed the old and new build systems???

Sorry for asking for this -- however hopefully it will sort out any problems you are having

regards

Andy

fuinelen_

25-01-2008 18:11:56

deleted everything and restarted from scratch using the wiki entry you linked to. It looks like the culprit is OIS

PythonOgre.BuildModule: INFO Retrieving http://prdownloads.sourceforge.net/wgois/ois-1.0RC1.tar.gz
PythonOgre.BuildModule: INFO Build Command tar zxf /home/sammy/development/downloads/ois-1.0RC1.tar.gz --overwrite
PythonOgre.BuildModule: INFO Build Command ./bootstrap
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command ./configure --prefix=/home/sammy/development/root/usr --includedir=/home/sammy/development/root/usr/include
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command make install
PythonOgre.BuildModule: WARNING Task Failed


./bootstrap is in the OIS-1.0RC1 directory and it is executable though :/

Is there anyway I can ./bootstrap and build OIS manually and continue from there on?

Game_Ender

25-01-2008 19:41:19

Did you check the log.out file? It should say how the bootstrap failed. Its probably the autotools setup on your computer.

fuinelen_

25-01-2008 20:16:24

that's the current log.out file (I let it continue despite the error .. i'm incredibly optimistic at times;)

01-25 14:09 PythonOgre.BuildModule INFO Building Source code for ois
01-25 14:09 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/sammy/development/python-ogre/code_generators/ois'
01-25 14:09 PythonOgre.BuildModule WARNING Task Failed
01-25 14:09 PythonOgre.BuildModule DEBUG
01-25 14:09 PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 299, in <module>
generate_code()
File "generate_code.py", line 214, in generate_code
, cflags=environment.ois.cflags
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pyplusplus/module_builder/builder.py", line 90, in __init__
, indexing_suite_version)
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pyplusplus/module_builder/builder.py", line 144, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/project_reader.py", line 225, in read_files
return self.__parse_file_by_file(files)
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/project_reader.py", line 246, in __parse_file_by_file
, self.__decl_factory )
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/source_reader.py", line 88, in __init__
self.__config.raise_on_wrong_settings()
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/config.py", line 166, in raise_on_wrong_settings
super( gccxml_configuration_t, self ).raise_on_wrong_settings()
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/config.py", line 105, in raise_on_wrong_settings
, self.include_paths )
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/config.py", line 104, in <lambda>
map( lambda idir: self.__ensure_dir_exists( idir, 'include directory' )
File "/home/sammy/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/config.py", line 96, in __ensure_dir_exists
raise RuntimeError( '%s("%s") does not exist!' % ( meaning, dir_path ) )
RuntimeError: include directory("/home/sammy/development/root/usr/include/OIS") does not exist!

01-25 14:09 PythonOgre.BuildModule INFO Compiling Source code for ois
01-25 14:09 PythonOgre.BuildModule DEBUG Spawning 'scons PROJECTS=ois' in '/home/sammy/development/python-ogre'
01-25 14:09 PythonOgre.BuildModule WARNING Task Failed
01-25 14:09 PythonOgre.BuildModule DEBUG scons: Reading SConscript files ...
Building ois
WARNING: Generate the sources in this directory: "/home/sammy/development/python-ogre/generated/ois_1.1"

01-25 14:09 PythonOgre.BuildModule DEBUG OSError: [Errno 2] No such file or directory: '/home/sammy/development/python-ogre/generated/ois_1.1':
File "/home/sammy/development/python-ogre/SConstruct", line 188:
sourcefiles = get_source_files(cls, cls._source, usepch)
File "/home/sammy/development/python-ogre/SConstruct", line 87:
raise e

01-25 14:09 PythonOgre.BuildModule INFO Building Source code for ogre
01-25 14:09 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/sammy/development/python-ogre/code_generators/ogre'
01-25 14:13 PythonOgre.BuildModule INFO Compiling Source code for ogre
01-25 14:13 PythonOgre.BuildModule DEBUG Spawning 'scons PROJECTS=ogre' in '/home/sammy/development/python-ogre'


/home/sammy/development/python-ogre/generated/ has only one directory in it currently, that's "Ogre_1.4".