Cannot genPyCode on Mac OS

After clearing a hurdle that I’ll address elsewhere, I successfully built dtool, panda and direct on my system and the proceeded to the next step, which is genPyCode. When I got there, i was confronted with the following stacktrace:

$ genPyCode
Traceback (most recent call last):
  File "/usr/local/panda/bin/genPyCode.py", line 7, in ?
    from direct.ffi import DoGenPyCode
  File "/usr/local/panda/lib/direct/ffi/DoGenPyCode.py", line 11, in ?
    from direct.ffi import FFIConstants
  File "/usr/local/panda/lib/direct/ffi/FFIConstants.py", line 3, in ?
    from direct.directnotify.DirectNotifyGlobal import *
  File "/usr/local/panda/lib/direct/directnotify/DirectNotifyGlobal.py", line 3, in ?
    import DirectNotify
  File "/usr/local/panda/lib/direct/directnotify/DirectNotify.py", line 5, in ?
    import Notifier
  File "/usr/local/panda/lib/direct/directnotify/Notifier.py", line 6, in ?
    from direct.showbase import PythonUtil
  File "/usr/local/panda/lib/direct/showbase/PythonUtil.py", line 51, in ?
    from libpandaexpress import ConfigVariableBool
ImportError: Loaded module does not contain symbol _initlibpandaexpress

I have inspected /usr/local/panda/lib/libpandaexpress.[so|dylib] w/ otool:

$ otool -L libpandaexpress.so
libpandaexpress.so:
        libpandaexpress.dylib (compatibility version 0.0.0, current version 0.0.0)
        libdownloader.dylib (compatibility version 0.0.0, current version 0.0.0)
        libexpress.dylib (compatibility version 0.0.0, current version 0.0.0)
        libpandabase.dylib (compatibility version 0.0.0, current version 0.0.0)
        libdconfig.dylib (compatibility version 0.0.0, current version 0.0.0)
        libprc.dylib (compatibility version 0.0.0, current version 0.0.0)
        libinterrogatedb.dylib (compatibility version 0.0.0, current version 0.0.0)
        libdtoolutil.dylib (compatibility version 0.0.0, current version 0.0.0)
        libdtoolbase.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
        /usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
        /usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)

Finding no problems with the paths it’s linked against, I proceeded to examine the symbol table (via nm):

$ nm libpandaexpress.so
00000f59 t ___cxa_atexit
00000000 t ___dso_handle
00000ffa s ___i686.get_pc_thunk.bx
00000958 t __dyld_func_lookup
         U __keymgr_get_and_lock_processwide_ptr
         U __keymgr_get_and_lock_processwide_ptr_2
         U __keymgr_set_and_unlock_processwide_ptr
00000000 t __mh_bundle_header
00000b9d t _add_routine
00000f86 t _atexit
00000dc3 t _atexit_common
         U _calloc
000009bb t _check_cxa_atexit
00000977 t _cxa_atexit_check_1
00000966 t _cxa_atexit_check_2
00000cf2 t _cxa_atexit_wrapper
         U _dlopen
         U _dlsym
         U _free
00000a30 t _get_globals
         U _malloc
00000c36 t _run_routines
00001000 d dyld__mach_header
00000944 t dyld_stub_binding_helper

I was unable to find the requested symbol w/ nm, so I wonder if maybe the build broke and didn’t throw a make error? I don’t know anything about the build process, so I’m not sure what my next debugging step should be.

Note: I haven’t included the output from evaluation of the .dylib files, but I did inspect them and didn’t find anything out of accord with what is in this post. I can include them if people need.

I suspect that you didn’t tell Config.pp where to find your version of Python, so it built you a version of Panda that wasn’t compiled to use Python. When you run ppremake in dtool, you should see a line like this:

Compilation will generate Python interfaces.

If you see instead:

Configuring Panda WITHOUT Python interfaces.

then you are about to build a Python-free version of Panda.

David