sms-tools icon indicating copy to clipboard operation
sms-tools copied to clipboard

tk and tcl dependencies

Open beroal opened this issue 4 years ago • 1 comments

While README.md specifies dependencies for sms-tools like matplotlib, it misses tk and tcl. Without both, I get

python models_GUI.py
Traceback (most recent call last):
  File "/home/user/prg/gitclone/sms-tools/software/models_interface/models_GUI.py", line 6, in <module>
    from Tkinter import *   ## notice capitalized T in Tkinter 
ModuleNotFoundError: No module named 'Tkinter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/prg/gitclone/sms-tools/software/models_interface/models_GUI.py", line 9, in <module>
    from tkinter import *   ## notice lowercase 't' in tkinter here
  File "/usr/lib/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory

Without tcl, but with tk, I get

python models_GUI.py
Traceback (most recent call last):
  File "/home/user/prg/gitclone/sms-tools/software/models_interface/models_GUI.py", line 6, in <module>
    from Tkinter import *   ## notice capitalized T in Tkinter 
ModuleNotFoundError: No module named 'Tkinter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/prg/gitclone/sms-tools/software/models_interface/models_GUI.py", line 9, in <module>
    from tkinter import *   ## notice lowercase 't' in tkinter here
  File "/usr/lib/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtcl8.6.so: cannot open shared object file: No such file or directory

ArchLinux, Python 3.9.1.

beroal avatar Feb 20 '21 20:02 beroal

This solution from SO worked for me on macOS Big Sur 11.3: https://stackoverflow.com/a/55651778

Quoting the author:

For Mac users,

Uninstall pyenv completely: brew uninstall pyenv && rm -rf ~/.pyenv. install zlib, tcl-tk and pyenv brew update brew install zlib brew install tcl-tk #otherwise we may have problems with tf package brew install pyenv Make compilers find zlib. Add this to your ~/.bashrc or ~/.zshrc (if you youse oh-my-zsh) For compilers to find zlib you may need to set: export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"

For pkg-config to find zlib you may need to set: export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" Then you are set up!. For more details check this github gist.

alexsivris avatar May 16 '21 12:05 alexsivris