Code: |
DirectStart: Starting the game. Traceback (most recent call last): File "Tut-Asteroids.py", line 16, in <module> import direct.directbase.DirectStart File "linuxroot/usr/share/panda3d/direct/src/directbase/DirectStart.py", line 3, in <module> File "linuxroot/usr/share/panda3d/direct/src/showbase/ShowBase.py", line 10, in <module> File "/usr/share/panda3d/pandac/PandaModules.py", line 1, in <module> from libpandaexpressModules import * File "/usr/share/panda3d/pandac/libpandaexpressModules.py", line 1, in <module> from extension_native_helpers import * File "/usr/share/panda3d/pandac/extension_native_helpers.py", line 38, in <module> from libpandaexpress import * ImportError: /usr/lib/panda3d/libpandaexpress.so: undefined symbol: PyUnicodeUCS4_AsWideChar |
In my copy of ubuntu gutsy, there's a configuration file called "/usr/include/python2.5/pyconfig.h" which contains this line:
#define Py_UNICODE_SIZE 4
This, in turn, causes Py_UNICODE_WIDE to be defined. That, in turn, causes this to happen:
#ifndef Py_UNICODE_WIDE
#define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar
#else
#define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
#endif
Since the ubuntu gutsy Panda3D distribution was compiled using this copy of python, when it calls PyUnicode_AsWideChar, it's really calling PyUnicodeUCS4_AsWideChar.
My theory is this: your copy of python was compiled with Py_UNICODE_SIZE 2. You can probably check this by looking in your copy of pyconfig.h. If that's the case, then that would explain why your copy of python isn't providing this function.
I deleted my Python installation in /usr/local, downloaded the newest stable (2.5.2), ran ./configure --enable-unicode=ucs4 then make and make install. After this, run "python" and see if the version/date built make sense. Then, do the following
Code: |
import sys if sys.maxunicode > 65535: print 'UCS4 build' else: print 'UCS2 build' |
If this comes out to UCS4, you're good. Then create /usr/local/lib/python2.5/site-packages/panda3d.pth with the two lines "/usr/share/panda3d" and "/usr/lib/panda3d". Then go back to an interpreter and do sys.path and make sure they're there. Then the demos worked.
Finding the problem was difficult, but the solution is simple. So this error really, as far as I can tell, isn't that big a deal. ./configure --enable-unicode=ucs4 is the answer.