Crystal Space
Welcome, Guest. Please login or register.
September 24, 2014, 05:42:35 am

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8507 Members
Latest Member: Ellieanna
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  problem running python tutorial with crystalspace 1.4
« previous next »
Pages: [1] Print
Author Topic: problem running python tutorial with crystalspace 1.4  (Read 2371 times)
Seb
Newbie
*
Posts: 9


View Profile Email
« on: December 10, 2009, 09:41:51 pm »

Hello,

I have downloaded the latest 1.4 from SVN here: http://crystal.svn.sourceforge.net/svnroot/crystal/CS/tags/V1.4.0
I am running on xubuntu 9.10, and was able to compile everything, install and get walktest to work.

Now, my goal is to go ahead with python bindings. I was trying to run an example to make sure environment was ok before
 doing more complicated stuff. It failed for a reason that I have hard time to identify (note: I am a beginner in python, so something obvious might be happening ...).

The command I am trying is:

Code:
seb@seb-laptop:~/Dev/crystal-1.4$ python scripts/python/tutorial3.py
Traceback (most recent call last):
  File "scripts/python/tutorial3.py", line 180, in <module>
    if not csInitializer.RequestPlugins(object_reg, plugin_requests):
  File "/usr/local/share/crystalspace-1.4/bindings/python/cspace/core.py", line 2509, in _csInitializer_RequestPlugins
    lambda x: _get_tuple(x), plugins):
  File "/usr/local/share/crystalspace-1.4/bindings/python/cspace/core.py", line 2509, in <lambda>
    lambda x: _get_tuple(x), plugins):
  File "/usr/local/share/crystalspace-1.4/bindings/python/cspace/core.py", line 2504, in _get_tuple
    return tuple(x())
  File "/usr/local/share/crystalspace-1.4/bindings/python/cspace/core.py", line 2540, in CS_REQUEST_IMAGELOADER
    iImageIO)
NameError: global name 'iImageIO' is not defined

I am not sure how to debug that since the binary works and finds the plugins. Any advice on how to debug that
or an info stating that python binding is working for him ?

Additional info:
PYTHONPATH=/usr/local/share/crystalspace-1.4/bindings/python
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/crystalspace-1.4
Python 2.6.4 (r264:75706, Nov  2 2009, 14:38:03)


Best regards,

Seb.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: December 11, 2009, 10:43:44 am »

Hmm.. It works fine for me. Make sure you have no extra version of CS that is installed on your system that may be confusing things. Also perhaps try to install swig, configure CS again and maybe do 'jam bindings' after building.

Greetings,
Logged
Seb
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: December 12, 2009, 09:29:03 pm »

Thanck you for the input. I have tried something even more radical: I have installed the debian package created by 'caedes', and I have the same problem. So,ithas to be a bad manipulation on my side.

I'll learn more about python, review the python tutorial on the web site that I thought I did follow step by step, and see.

Best regards,

Seb
Logged
Seb
Newbie
*
Posts: 9


View Profile Email
« Reply #3 on: December 12, 2009, 09:41:46 pm »

Ha! I thinck I have found:

In the python tutorial, it is mentionned 'swig > 1.3.33 might cause Crash. Since configure was simply looking for better than some version, I assumed it was ok !
The latest ubuntu distributions comes with 1.3.36. So, I am recompiling everything with that and keep updated in that post.

Best regards,

Seb.
Logged
Seb
Newbie
*
Posts: 9


View Profile Email
« Reply #4 on: December 14, 2009, 07:56:21 am »

Unfortunatly, this is not due to Swig versions.

iImageIO symbol and few others are still undefined, while other are ok. So, I am recompiling
 with a log to check if something usable is generated to track the problem.

Seb
Logged
Seb
Newbie
*
Posts: 9


View Profile Email
« Reply #5 on: December 15, 2009, 10:36:43 pm »

I have tried quite a few things, let me summurise:

- I have walked into the python debugger through tutorial1.py, and some plugins are loaded Ok, some are not because there symbol in python is lost.
I have reduced the python test case to what seems a minimal length:

Code:
import sys

from cspace import *

object_reg = csInitializer.CreateEnvironment(sys.argv)

def Report (severity, msg):
    csReport(object_reg, severity, "crystalspace.application.python", msg)


if not csInitializer.SetupConfigManager(object_reg):
    Report(CS_REPORTER_SEVERITY_ERROR, "Couldn't init app!")
    sys.exit(1)

plugin_requests = [CS_REQUEST_IMAGELOADER]
if not csInitializer.RequestPlugins(object_reg, plugin_requests):
    Report(CS_REPORTER_SEVERITY_ERROR, "Plugin requests failed!")
    sys.exit(1)

The 'iImageIO' symbol is still valid until the code enter  csInitializer.RequestPlugins(object_reg, plugin_requests), where for some reasons it get losts.
From there, since I am not expecting a symbol to disappear magically, I suspect that some code in python or generated swig has done some evil things.
I have tried:
python 2.6.4 + swig 1.3.36 => ko
python 2.5.4 + swig 1.3.36 => ko
python 2.5.4 + swig 1.3.31 => ko

so, when falling to python 2.5 and swig 1.3.31, I thinck I am back to 'rather stable' (I have done a quick search on the swig tracker but did not find anything striking).

So, before going into very new thing for me which would be to step into python code to understand what is happening, can someone state the version of python, swig, gcc that is working for you on release crystal 1.4 ? Please tell me if you are compiling 'optimized' code or debug.

Best regards,

Seb.
Logged
Vincent
Full Member
***
Posts: 191


View Profile WWW
« Reply #6 on: February 07, 2010, 11:50:51 am »

Hello

  afaik Swig 1.3.33 is the best choice.
Maybe some newer version like 1.3.39 or 1.3.40 works too, but I haven't checked yet.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.473 seconds with 14 queries.