Skip to content

Briefcase run does not include Tkinter #318

Closed
@saroad2

Description

@saroad2

This is going to be quite long, hope It's Ok

I have a Briefcase project that shows matplotlib plots from a compact GUI.
I'm working on Windows with python3.7. When I run my program using briefcase dev it's working ok, but when trying to run it with breifcase run it fails.
I went down the rabbit hole and saw that on windows it runs the program using windows\src\FORMAL_NAME\python\pythonw.exe -m MY_PACKAGE_NAME. I tried to run it manually and saw that nothing is printed, not an error and not anything else.

I saw that in the same directory there is a python.exe file so I ran it with -m MY_PACKAGE_NAME and I got the following error:

Traceback (most recent call last):
  File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\runpy.py", line 193, in _run_module_as_main
  File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\runpy.py", line 85, in _run_code
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app\eddington_gui\__main__.py", line 1, in <module>
    from eddington_gui.app import main
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app\eddington_gui\app.py", line 6, in <module>
    from eddington import read_data_from_excel, InvalidDataFile, plot_fitting, plot_residuals, PlotConfiguration
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\eddington\__init__.py", line 18, in <module>
    from eddington.plot.residuals import plot_residuals
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\eddington\plot\residuals.py", line 1, in <module>
    from eddington.plot.util import title, label_axes, horizontal_line, plot_data, show_or_export
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\eddington\plot\util.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\matplotlib\pyplot.py", line 2282, in <module>
    switch_backend(rcParams["backend"])
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\matplotlib\pyplot.py", line 221, in switch_backend
    backend_mod = importlib.import_module(backend_name)
  File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\__init__.py", line 127, in import_module
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\matplotlib\backends\backend_tkagg.py", line 1, in <module>
    from . import _backend_tk
  File "C:\Users\saroa\repositories\eddington_gui\windows\EddingtonGUI\src\\app_packages\matplotlib\backends\_backend_tk.py", line 6, in <module>
    import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'

I looked at the windows\src\FORMAL_NAME\python\ and I saw that indeed Tkinter is not there.
Is that on purpose? how can I manually add Tkinter to there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions