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

ModuleNotFoundError: No module named '_tkinter' #15

Open
sbilque opened this issue Oct 17, 2022 · 1 comment
Open

ModuleNotFoundError: No module named '_tkinter' #15

sbilque opened this issue Oct 17, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@sbilque
Copy link

sbilque commented Oct 17, 2022

Bug Summary

The module cannot be imported if the tkinter module is not installed in Python.

Module version

v0.2.0

Platform version

  • Python 3.7.3
  • RHEL 7

Steps to reproduce

  • install the 0.2.0 version
    pip install tideway==0.2.0
  • import the module in your code :
       #!/usr/bin/env python3
       # coding: utf-8
       import os
       import sys
       from pathlib import Path
       import argparse
       import json
       import tideway

Actual results

The following error message appears with running the code :

    import tideway
  File "/venv/lib/python3.7/site-packages/tideway-0.2.0-py3.7.egg/tideway/__init__.py", line 4, in <module>
    from tideway import main, \
  File "/venv/lib/python3.7/site-packages/tideway-0.2.0-py3.7.egg/tideway/main.py", line 4, in <module>
    from tkinter import BASELINE
  File "/usr/local/lib/python3.7/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

Additional information

tkinter is imported in main.py as follows :

from tkinter import BASELINE
@codefitz codefitz added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Oct 17, 2022
@codefitz
Copy link
Member

Can confirm this issue. Current workaround is as follows:

From the command line, install tkinter using package manager (Debian/Ubuntu):

sudo apt install python3-tk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants