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

pyspedas import fails if tkinter isn't installed #1062

Open
jameswilburlewis opened this issue Nov 20, 2024 · 0 comments
Open

pyspedas import fails if tkinter isn't installed #1062

jameswilburlewis opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working CDAWeb python Issues involving Python and Python-related tools outside of pyspedas

Comments

@jameswilburlewis
Copy link
Contributor

Richard Strub ([email protected]) reported an issue:

We are displaying feeps and eis now in our visualizer. To do that we needed the algorithms from pyspedas.
So now we are importing pyspedas into our project!
It works great on my mac but when we deploy it to a container where we must specify our environment we are
Having problems with tkinter…

import pyspedas
2024-11-20T17:54:24.303732078Z   File "/usr/local/lib/python3.9/dist-packages/pyspedas/__init__.py", line 15, in <module>
2024-11-20T17:54:24.303843275Z     from .cdagui_tools.cdagui import cdagui
2024-11-20T17:54:24.303859517Z   File "/usr/local/lib/python3.9/dist-packages/pyspedas/cdagui_tools/cdagui.py", line 23, in <module>
2024-11-20T17:54:24.303979849Z     import tkinter as tk
2024-11-20T17:54:24.303993189Z ModuleNotFoundError: No module named 'tkinter'

We are trying to install and import tkinter in every way possible but nothing seems to change this message…

tkinter is bundled with most Python installs, so we just assume it's available to be imported. But in a container environment that's not meant for interactive GUI use, that assumption might not be correct. We should adjust the CDAWeb GUI code to catch any "ModuleNotFoundError", then set a flag somewhere if it's not usable. At runtime. we could check that flag and bail out early if tkinter isn't available. That way, the rest of pyspedas will still be usable even if the CDAWeb GUI won't run.

@jameswilburlewis jameswilburlewis added bug Something isn't working python Issues involving Python and Python-related tools outside of pyspedas CDAWeb labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CDAWeb python Issues involving Python and Python-related tools outside of pyspedas
Projects
None yet
Development

No branches or pull requests

1 participant