PdfNet Python exception during import

212 views
Skip to first unread message

Oleg Solovey

unread,
Feb 27, 2017, 7:47:41 PM2/27/17
to PDFTron PDFNet SDK
Can't import a module in my application, tests work fine though. What am I doing wrong?

code:
import site
site.addsitedir("/Users/myuser/Downloads/PDFNetWrappersMac/PDFNetC/Lib")
import sys

from PDFNetPython import *


exception:
'dlopen(/Users/myuser/Downloads/PDFNetWrappersMac/PDFNetC/Lib/_PDFNetPython.so, 2): Library not loaded: @rpath/libPDFNetC.dylib
Referenced from: /Users/myuser/Downloads/PDFNetWrappersMac/PDFNetC/Lib/_PDFNetPython.so
Reason: image not found'

Ryan

unread,
Feb 28, 2017, 9:29:48 PM2/28/17
to PDFTron PDFNet SDK
import adds the Python library, but you still need to make the native library available, which you do with the following shell script code, before running python.

export LD_LIBRARY_PATH=../../../PDFNetC/Lib

Reply all
Reply to author
Forward
0 new messages