Compiling Panda on Python 2.7

Hello! I’m trying to compile Panda 1.6.2 on Windows with Python 2.7. Sadly I haven’t been successful so far.

I followed the instructions in here panda3d.org/manual/index.php … on_Windows and downloaded everything. Then I replaced Python 2.5 with 2.7 into thirdparty/win-python and launched makepanda.bat. The whole source code was compiled successfully but when I tried to launch a sample Panda script, Python complained because couldn’t find libpandaexpress (ImportError: Cannot find libpandaexpress.dll)

As a test, I tried to pre-load the dll file using imp.load_dynamic() and it didn’t work either (ImportError: DLL load failed: The specified module could not be found.). As a last tentative, I renamed the dll file into .pyd and still got the same error.

Any clue on what am I missing?

Are you sure that the directory containing the file is on your PYTHONPATH and also your PATH variable?

David

Thanks for the quick reply! When I did the import test, I launched the Python console from the directory of the .dll file so, I wish was a problem of paths but I don’t think it is. Any other suggestions?

That doesn’t prove anything. You still need to make sure that the current directory appears on your PYTHONPATH directory (or is at least given first in sys.path).

Anyway, you should also test to ensure that you can run the newly-built pview successfully. If you cannot, then you certainly won’t be able to import Panda into python.

David

Seems to work fine for me. Here’s an installer if you want to try it without compiling yourself.

dl.dropbox.com/u/1045993/panda3d … on-2.7.exe

dla is talking about Panda3D 1.6.2 which shipped by default with Python 2.5 if I remember right. Python 2.5 has been able to automatically load C-extensions from .pyd AND .dll files. Python 2.6 or later can only load .pyd files automatically.

I recall that we had to use the Python import-Modules to load the Panda3D libraries (which are .dll and not .pyd).

@dla
So if you want to use Panda3D 1.6.2 and Python 1.7 then you should have a look at the Panda3D 1.7.x code for preloading the .dlls and backport it to Panda-1.6.2. Or move on to Panda3D-1.7.x.

EDIT: Arg, I see you have already tried to do so. forget about my ramblings…

And for Mac OSX (10.6):

dl.dropbox.com/u/1045993/panda3d … on-2.7.dmg

Note: I had to get the code from CVS for this to work. The 1.7.1 download code package seems to be broken. A variable called _overlay_display_region exists only in an OSX-related file in the release and is never defined. In CVS it works fine though.

Note 2: The reason I wanted Panda3D with python 2.7 is to be able to use it with the last version of the Enthought Python Distribution (EPD) for scientific computing etc.

/Daniel