Need some help understanding PyD

Saurabh Das via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 8 22:16:11 PST 2017


I've been giving PyD a try. It's really nice and mostly 
everything works out of the box.

I'm trying to use TensorFlow in D via Pytho, so I need to call 
Python functions in D.

When I try to do:

     auto context = new InterpContext();
     context.py_stmts("import tensorflow");

I get this error:

pyd.exception.PythonException at source/app.d(19):
ImportError: 
/usr/lib/python3.4/lib-dynload/_ctypes.cpython-34m-x86_64-linux-gnu.so: undefined symbol: _PyTraceback_Add
----------------
../../.dub/packages/pyd-0.9.8/pyd/infrastructure/pyd/exception.d:46 void pyd.exception.handle_exception(immutable(char)[], ulong) [0x5917f6]
../../.dub/packages/pyd-0.9.8/pyd/infrastructure/pyd/embedded.d:147 void pyd.embedded.InterpContext.py_stmts(immutable(char)[], immutable(char)[], ulong) [0x59149a]
source/app.d:13 _Dmain [0x573cb2]
??:? 
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv 
[0x5abfae]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x5abf04]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll() [0x5abf6a]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x5abf04]
??:? _d_run_main [0x5abe61]
??:? main [0x575e6f]
??:? __libc_start_main [0x3fffbec4]
Program exited with code 1

How can I debug what the problem is?

Thanks,
Saurabh



More information about the Digitalmars-d-learn mailing list