0

I am using Tkinter in Python to handle the SpirentTestCenter API with Tcl code. I happen to use pandas as well and when used together, I am facing the library load issue.

import os
sStcVersion='4.73'
sStdPath = '/repo/dinesh/MY_PACKAGES/STC/'+sStcVersion
import pandas as pd
import Tkinter


tcl = Tkinter.Tcl()
tcl.eval('puts $::env(LD_LIBRARY_PATH)')
tcl.eval('source '+'/repo/dinesh/MY_PACKAGES/STC/'+sStcVersion+'/pkgIndex.tcl')
tcl.eval('package require SpirentTestCenter 4.73')

>>> Error Occured while loading the Spirent Automation Internal Utility Library (couldn't load file "/repo/MY_PACKAGES/STC/4.73/libsTcl.so": 
/repo/dinesh/MY_PACKAGES/robot/PACKAGES/lib_for_64bit_compat/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /repo/MY_PACKAGES/STC/4.73/libsTcl.so)).

The required libstdc++.so.6 is located in the same directory as libsTcl.so (i.e./repo/MY_PACKAGES/STC/4.73/). But it is taking the libstdc++.so.6 from the another directory which is available in the LD_LIBRARY_PATH. I tried changing the LD_LIBRARY_PATH , but still it is taking it from the incorrect directory.

If I don't import the pandas module, this issue is not seen. It seems like the libstdc++.so.6 is loaded already with pandas from /repo/dinesh/MY_PACKAGES/robot/PACKAGES/lib_for_64bit_compat/libstdc++.so.6.

How can I force python to take the libstdc++.so.6 from the preferred directory ?

1 Answer 1

1

But it is taking the libstdc++.so.6 from the another directory which is available in the LD_LIBRARY_PATH. I tried changing the LD_LIBRARY_PATH , but still it is taking it from the incorrect directory.

That suggests that either it's not getting it from LD_LIBRARY_PATH, or you didn't change LD_LIBRARY_PATH correctly.

You could try setting LD_PRELOAD=/repo/MY_PACKAGES/STC/4.73/libstdc++.so.6 in the environment, to load the desired version before anything else, so that when the loader sees a dependency to libstdc++.so.6 it already has the right one and won't try loading the wrong one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.