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

Imod should not import tkinter stuff in the init #109

Open
pconesa opened this issue Nov 25, 2021 · 3 comments
Open

Imod should not import tkinter stuff in the init #109

pconesa opened this issue Nov 25, 2021 · 3 comments

Comments

@pconesa
Copy link
Contributor

pconesa commented Nov 25, 2021

scipion@ip-172-31-26-199:~$ scipion3 run conda install tk-8.6.10-h14c3975_1005.tar.bz2
Scipion v3.0.9 - Eugenius
WARNING!!: Plugin containing module imod does not import properly. All its content will be missing in this execution.
Please, contact developers at http://scipion.i2pc.es/contact and send this ugly information below. They'll understand it!.
Traceback (most recent call last):
File "/home/scipion/scipion3/scipion-pyworkflow/pyworkflow/plugin.py", line 75, in registerPlugin
m = importlib.import_module(name)
File "/home/scipion/.conda/envs/scipion3/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/scipion/scipion3/Plugins/scipion-em-imod/imod/init.py", line 31, in
from pyworkflow.gui import FileTreeProvider
File "/home/scipion/scipion3/scipion-pyworkflow/pyworkflow/gui/init.py", line 26, in
from .gui import *
File "/home/scipion/scipion3/scipion-pyworkflow/pyworkflow/gui/gui.py", line 25, in
import tkinter as tk
File "/home/scipion/.conda/envs/scipion3/lib/python3.8/tkinter/init.py", line 36, in
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

@azazellochg
Copy link
Member

I removed tkinter imports from views_tkinter_tree, was that it?

@azazellochg
Copy link
Member

Now I see this is about file handlers.. not sure what can be done here..

@pconesa
Copy link
Contributor Author

pconesa commented Nov 10, 2022

Don't worry, this is to remember to do it in a different way.

Currently, the situation is:

1.- File handlers are provided by plugins
2.- They need to be registered as soon as possible...currently at plugin's init which end up importing tk in the import casacade.
3.- This is means that tk should be in the installation always, which is true, expect when you remove it when fixing fonts.

I've changed de documentation of the fix font to be a single command

In any case, we should find another mechanism to register the filehandlers triggered by the GUI.

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

2 participants