I have 2 scripts
- Python automation script where I am integrating IXIA (which is tcl based) script.
- One more script in Python again, just to connect to IXIA to login and send traffic on network, which works well.
But the problem I am facing is with integrating the same with my automation script, it displays
No module named Tkinter.
When I tried to solve the issue by googling and searching on other sites I found few solutions telling
to check with Tkinter (Python version <= 3) and Tkinter (python version >3) --> this is not the case
softlinking with the installation directory
- LD_LIBRARY_PATH variable--> tried
- TIX_LIBRARY variable--> tried
To understand the problem I tried moving the required installation directory (the crude/inappropriate way) to the automation directory it solved one issue of Tkinter and gave further 2 issues as below one by one
a. Traceback (most recent call last):
File "/share/apps/sts/sts_start.py", line 15, in <module>
import Tkinter
File "/share/apps/lib/python/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
b. Traceback (most recent call last):
File "/share/apps/sts/sts_start.py", line 15, in <module>
import Tkinter
File "/share/apps/lib/python/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libTix.so: cannot open shared object file: No such file or directory
These issues were expected as it will give issues with subsequent dependencies.
Directories copied are:
/usr/lib64/python2.6
;lib-tk
andlib-dynload
/usr/lib64/tcl8.5
into /share/apps/lib/python
Python version:
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
tcl version:
$ tclsh
% info patchlevel
8.5.7
%
Directory of lib-tk installation:
/usr/lib64/python/lib-tk
automation script library path:
/share/apps/lib/python/
$ls
arm_avp common dvtools lib-dynload lib-tk python2.6 site-packages sknobs strega_fe sts-packages tcl8.5
pasting my other environment variables below -
$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/latest/bin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/gridengine/bin/linux-x64:/share/apps/bin:/home/amcclab/bin
$ echo $PYTHONPATH
/share/apps/lib/python/arm_avp:/share/apps/lib/python/common:/share/apps/lib/python/dvtools:/share/apps/lib/python/lib-dynload:/share/apps/lib/python/lib-tk:/share/apps/lib/python/python2.6:/share/apps/lib/python/site-packages:/share/apps/lib/python/sknobs:/share/apps/lib/python/strega_fe:/share/apps/lib/python/sts-packages:/share/apps/lib/python/tcl8.5
Please guide me to get the Tkinter package working with my script.