Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dicomtree.py example not working due to tix #2

Open
massich opened this issue Aug 21, 2017 · 3 comments
Open

dicomtree.py example not working due to tix #2

massich opened this issue Aug 21, 2017 · 3 comments

Comments

@massich
Copy link
Member

massich commented Aug 21, 2017

Description

This is a migration from this pydicom issue

Original Issue

I'm going through the examples and I can not run dicomtree.

$ python dicomtree.py ~/Documents/my_dicomdir/

Traceback (most recent call last):
  File "dicomtree.py", line 71, in <module>
    root = tkinter_tix.Tk()
  File "/home/sik/miniconda3/lib/python3.6/tkinter/tix.py", lin
e 218, in __init__                                            
    self.tk.eval('package require Tix')
_tkinter.TclError: can't find package Tix

The main problem is tix, see the following ipython session:

from tkinter import tix
from tkinter.constants import *
root = tix.Tk()
Traceback (most recent call last):
  File "<ipython-input-20-c03089e228b3>", line 3, in <module>
    root = tix.Tk()
  File "/home/sik/miniconda3/lib/python3.6/tkinter/tix.py", line 218, in __init__
    self.tk.eval('package require Tix')
TclError: can't find package Tix

I don't understand the error since the libraries seem to be at the right place according to this thread

$ ldconfig -p | grep Tix
	libTix8.4.3.so.1 (libc6,x86-64) => /usr/lib/libTix8.4.3.so.1
	libTix8.4.3.so (libc6,x86-64) => /usr/lib/libTix8.4.3.so

This is my configuration:

Linux-4.8.0-49-generic-x86_64-with-debian-stretch-sid
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
ttk 0.3.1

More over tix is deprecated in fabour of ttk. (see python doc)

@vsoch
Copy link
Member

vsoch commented Aug 21, 2017

what output did this use to make? There are many lovely ways to show a file hierarchy, or image fields. If we want python (obviously) I would advocate for a simple flask (or other) script that just opens up a standard html/javascript view.

@vsoch
Copy link
Member

vsoch commented Aug 21, 2017

Eg, this is just django: https://pydicom.github.io/dicom-database/interface.html

@ferdymercury
Copy link
Contributor

ferdymercury commented Apr 14, 2021

Can you try this workaround?

try:
    if compat.in_py2:
        import Tix as tkinter_tix
    else:
        import tkinter.tix as tkinter_tix
except:
    import tkinter.tix as tkinter_tix

And did you do:
sudo apt install tix-dev
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants