Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Running on server causes crash at import of configurator gui #88

Closed
Muehli25 opened this issue Jun 8, 2021 · 4 comments
Closed

Running on server causes crash at import of configurator gui #88

Muehli25 opened this issue Jun 8, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@Muehli25
Copy link
Contributor

Muehli25 commented Jun 8, 2021

I am running the application on a server. When running version 3.0.0 it does crash when starting.
Stacktrace:

File "/mnt/user/opensoftware/impfbot/src/config_generator.py", line 2, in <module>
    import tkinter as tk
  File "/usr/lib64/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk

An easy fix is by only import the config generator and thereby tkinter, when needed.

sibalzer added a commit that referenced this issue Jun 9, 2021
(temporary) move import for gui elements
@sibalzer
Copy link
Owner

sibalzer commented Jun 9, 2021

We must look into a better fix than #89

Proposal by @paulypeter:

Could you try wrapping the tk import in a try-except block in config-generator.py instead?
Does it a raise a ModuleNotFoundError or an ImportError?

try:
import tkinter as tk
from tkinter import ttk
except Exception:
...

#89 (comment)

@sibalzer sibalzer added the bug Something isn't working label Jun 9, 2021
@Muehli25
Copy link
Contributor Author

Muehli25 commented Jun 9, 2021

Full Stacktrace:

Traceback (most recent call last):                                                                                                                    
  File "/mnt/user/opensoftware/impfbot/src/impfbot.py", line 8, in <module>                                                                           
    from config_generator import start_config_generation                                                                                              
  File "/mnt/user/opensoftware/impfbot/src/config_generator.py", line 2, in <module>                                                                  
    import tkinter as tk                                                                                                                              
  File "/usr/lib64/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

@paulypeter
Copy link
Collaborator

Thank you!

@sibalzer
Copy link
Owner

sibalzer commented Jun 9, 2021

closed with #98

@sibalzer sibalzer closed this as completed Jun 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants