blender via command line.. strange errors

Hi I wonder if you guys can help me with this problem. I’m writing some software in c++ that will pass some data to blender via it’s command line interface. blender takes that data and generates a .obj file and quits.

Everything works as expected. I’ve tested on multiple computers (all MacOS X 10.6), but on my friend’s system (the one that it’s actually important to run on) I get this error:

found bundled python: /<path-to-app-deleted>/tangled.app/Contents/Resources/blender/2.53/python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
ImportError: No module named encodings.utf_8

I take that to mean it can’t find the bundled python modules.

This is what the folder structure of my app looks like:

So thinking this was a problem with blender not finding the right python install, I set my PYTHONHOME and PYTHONPATH from inside c++ before launching blender:

PYTHONHOME=/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/python
PYTHONPATH=/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/addons
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/keyingsets
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/cfg
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/io
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/op
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/ui
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts
:/Users/ryan/_cinder/writtenimages/xcode/build/Release/tangled.app/Contents/Resources/blender/2.53/scripts/modules

And that works on my machine but not his. Anyone have any idea of what the problem could be, or something to try?

Thanks
ryan