0

I use the free Anaconda distribution 1.9.6 with python 3.7.1 to run an interface in tkinter, for which I need a scientifique simulation software called SIMPSON written in TCL to be executed.

The software in question: https://inano.au.dk/about/research-centers/nmr/software/simpson/ (This software installs without malware or any inconvenience other than the one discussed here if someone wants to test)

The problem is, even the execution of the simple code:

import tkinter as tk

main_window = tk.Tk()
main_window.mainloop()

… returns the error message:

File "", line 1, in runfile('R:/tests/MWE/tkinter_test.py', wdir='R:/tests/MWE')

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile execfile(filename, namespace)

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "R:/tests/MWE/tkinter_test.py", line 10, in main_window = tk.Tk()

File "C:\ProgramData\Anaconda3\lib\tkinter__init__.py", line 2023, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)

TclError: Can't find a usable init.tcl in the following directories: {C:\Program Files (x86)\SIMPSON\tcl8.6} C:/ProgramData/Anaconda3/lib/tcl8.6 C:/ProgramData/lib/tcl8.6 C:/lib/tcl8.6 C:/ProgramData/library C:/library C:/tcl8.6.8/library C:/tcl8.6.8/library

C:/Program Files (x86)/SIMPSON/tcl8.6/init.tcl: version conflict for package "Tcl": have 8.6.8, need exactly 8.6.2 version conflict for package "Tcl": have 8.6.8, need exactly 8.6.2 while executing "package require -exact Tcl 8.6.2" (file "C:/Program Files (x86)/SIMPSON/tcl8.6/init.tcl" line 19) invoked from within "source {C:/Program Files (x86)/SIMPSON/tcl8.6/init.tcl}" ("uplevel" body line 1) invoked from within "uplevel #0 [list source $tclfile]"

This probably means that Tcl wasn't installed properly.

SIMPSON executes normally. The problem disappears only after uninstallation of SIMPSON and re-installation of Anaconda, but there must be a simpler way …

1 Answer 1

0

From the error message I think the Tcl bundled with SIMPSON is making a problem with the anaconda Tcl as both are on different versions. Tcl on SIMPSON is 8.6.2 and the Tcl on your anaconda is 8.6.8 which satisfy Tkinter version 8.6.8. Which means Tkinter can't run with Tcl >= 8.6.8.

Updating Tcl on SIMPSON should fix the error. You can also try update Anaconda Tcl maybe that fix the issue.

Updating Tcl/Tk on your Anaconda from command line (More Details).

Commands:

conda install -c conda-forge tk 
conda install -c conda-forge/label/gcc7 tk 
conda install -c conda-forge/label/broken tk 
conda install -c conda-forge/label/cf201901 tk
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.