mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.39k stars 433 forks source link

"Unknown sequence number while appending request" error when using Tkinter #2407

Open dconover23 opened 1 year ago

dconover23 commented 1 year ago

What were you trying to do?

I'm a new Python programmer and am attempting to create a Tkinter application. However, whenever I try to run it, I get the error described in the title.

What steps did you take to trigger the issue?

  1. Create a Tkinter application and attempt to add any widgets (entries, labels, etc.)
  2. Run it.
  3. Get the following error:

"[xcb] Unknown sequence number while appending request [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. python: ../../src/xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

---------- FINISHED ---------- exit code: 6 status: 1"

What did you expect to happen?

The application should open a window with the relevant widgets.

What actually happened?

The application crashed with the error listed above.

Operating System Version

Ubuntu 22.04 LTS

Mu Version

1.2.0

Other Info

No response

Editor Log

2023-03-08 08:39:13,545 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/session.json 2023-03-08 08:39:13,547 - mu.logic:1430(quit) INFO: Quitting.

2023-03-08 08:39:13,547 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/session.json 2023-03-08 08:39:13,548 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/venv.json 2023-03-08 08:44:18,286 - root:283(run) INFO:


Starting Mu 1.2.0 2023-03-08 08:44:18,286 - root:284(run) INFO: uname_result(system='Linux', node='bunny-Latitude-E6530', release='5.19.0-35-generic', version='#36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2', machine='x86_64', processor='x86_64') 2023-03-08 08:44:18,288 - root:285(run) INFO: Platform: Linux-5.19.0-35-generic-x86_64-with-glibc2.2.5 2023-03-08 08:44:18,288 - root:286(run) INFO: Python path: ['/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python38.zip', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/site-packages'] 2023-03-08 08:44:18,288 - root:287(run) INFO: Language code: en_US 2023-03-08 08:44:18,289 - mu.settings:220(load) WARNING: No settings file found at /home/bunny/.local/share/mu/settings.json; skipping 2023-03-08 08:44:18,289 - root:312(run) INFO: Wayland detected, setting QT_QPA_PLATFORM=wayland 2023-03-08 08:44:18,696 - mu.virtual_environment:619(ensure_and_create) INFO: Added log handler. 2023-03-08 08:44:18,696 - mu.virtual_environment:630(ensure_and_create) DEBUG: Checking virtual environment; attempt #1. 2023-03-08 08:44:18,697 - mu.virtual_environment:719(ensure_path) INFO: Virtual Environment found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056 2023-03-08 08:44:18,697 - mu.virtual_environment:740(ensure_interpreter) INFO: No interpreter found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:44:18,697 - mu.virtual_environment:750(ensure_interpreter) INFO: Symlinked /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python to AppImage's /tmp/.mount_Mu_EdiyxMJdQ/usr/bin/python3.8 2023-03-08 08:44:18,698 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import sys; print("%s%s" % sys.version_info[:2])') with kwargs {'shell': False} 2023-03-08 08:44:18,754 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: 38 2023-03-08 08:44:18,754 - mu.virtual_environment:786(ensure_interpreter_version) INFO: Both interpreters at version 38 2023-03-08 08:44:18,754 - mu.virtual_environment:815(ensure_pip) INFO: Pip found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/pip 2023-03-08 08:44:18,754 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: pgzero 2023-03-08 08:44:18,754 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import pgzero') with kwargs {'shell': False} 2023-03-08 08:44:18,801 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:44:18,801 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: flask 2023-03-08 08:44:18,801 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import flask') with kwargs {'shell': False} 2023-03-08 08:44:19,144 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:44:19,145 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: ipykernel 2023-03-08 08:44:19,145 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import ipykernel') with kwargs {'shell': False} 2023-03-08 08:44:19,751 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:44:19,752 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: ipython_genutils 2023-03-08 08:44:19,752 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import ipython_genutils') with kwargs {'shell': False} 2023-03-08 08:44:19,797 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:44:19,797 - mu.virtual_environment:662(ensure_and_create) INFO: Valid virtual environment found at /home/bunny/.local/share/mu/mu_venv-38-20230307-205056 2023-03-08 08:44:19,799 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/venv.json 2023-03-08 08:44:19,817 - mu.logic:777(init) INFO: Setting up editor. 2023-03-08 08:44:19,822 - mu.logic:801(init) INFO: Log directory: /home/bunny/.cache/mu/log 2023-03-08 08:44:19,822 - mu.logic:802(init) INFO: Data directory: /home/bunny/.local/share/mu 2023-03-08 08:44:19,822 - mu.logic:816(setup) INFO: Available modes: python, snek, circuitpython, microbit, esp, web, pyboard, debugger, pygamezero, lego, pico 2023-03-08 08:44:19,822 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:44:20,007 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:44:20,008 - mu.logic:1583(change_mode) INFO: Workspace directory: /home/bunny/mu_code 2023-03-08 08:44:20,008 - mu.logic:890(restore_session) DEBUG: <SessionSettings from /home/bunny/.local/share/mu/session.json> 2023-03-08 08:44:20,021 - mu.logic:912(restore_session) INFO: Loaded files. 2023-03-08 08:44:20,021 - mu.logic:918(restore_session) INFO: User defined environment variables: {} 2023-03-08 08:44:20,022 - mu.logic:923(restore_session) INFO: Minify scripts on micro:bit? False 2023-03-08 08:44:20,041 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:44:20,041 - mu.logic:1583(change_mode) INFO: Workspace directory: /home/bunny/mu_code 2023-03-08 08:44:20,158 - mu.logic:980(restore_session) INFO: Starting with blank file. 2023-03-08 08:44:23,476 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:44:23,476 - mu.logic:1152(get_dialog_directory) INFO: Using path for file dialog: /home/bunny/mu_code 2023-03-08 08:45:25,908 - mu.interface.main:416(get_load_path) DEBUG: Getting load path: /home/bunny/Documents/Weirdo-Weather-Station/weather.py 2023-03-08 08:45:25,908 - mu.logic:1015(_load) INFO: Loading script from: /home/bunny/Documents/Weirdo-Weather-Station/weather.py 2023-03-08 08:45:25,909 - mu.logic:332(read_and_decode) DEBUG: Trying to decode with utf-8 2023-03-08 08:45:25,909 - mu.logic:335(read_and_decode) INFO: Decoded with utf-8 2023-03-08 08:45:25,910 - mu.logic:348(read_and_decode) DEBUG: Detected newline '\n' 2023-03-08 08:45:25,911 - mu.logic:1114(_load) DEBUG: # weather.py: Contains all the important weather-accessing stuff. import requests import json

api_key = "32244071f3e58861bea8ab0d64ef14b5"

"Base" URL to initialize with

base_url = "http://api.openweathermap.org/data/2.5/weather?"

class Weather: def init(self, city): self.city = city

# Gets the city and all relevant API info
def getCity(self, city_name):
    city_name = self.city

    # Finish the URL
    complete_url = base_url + "appid=" + api_key + "&q" + city_name

    # Send URL to API
    response = requests.get(complete_url)

    # Results come back in json
    result = response.json()

    # Make sure API is up
    if result["cod"] != 404:
        main = result["main"]

        # Get current temperature
        current_temp = main["temp"]

        # Convert it to fahrenheit from kelvin
        current_temperature = round((current_temp - 273.15) * 1.8 + 32)

        return current_temperature

2023-03-08 08:45:35,454 - mu.logic:992(toggle_theme) INFO: Toggle theme to: contrast 2023-03-08 08:45:36,278 - mu.logic:992(toggle_theme) INFO: Toggle theme to: day 2023-03-08 08:46:02,850 - mu.logic:1439(show_admin) INFO: Showing admin with logs from /home/bunny/.cache/mu/log/mu.log 2023-03-08 08:46:02,850 - mu.virtual_environment:984(installed_packages) INFO: Discovering installed third party modules in venv. 2023-03-08 08:46:02,850 - mu.virtual_environment:139(run_blocking) INFO: About to run blocking /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/pip with args ['list', '--disable-pip-version-check'] and envvars {} 2023-03-08 08:46:03,549 - mu.virtual_environment:189(wait) DEBUG: Finished: True; exitStatus 0; exitCode 0 2023-03-08 08:46:03,550 - mu.virtual_environment:274(run) DEBUG: Process output: Package Version


asttokens 2.1.0 backcall 0.2.0 certifi 2022.12.7 charset-normalizer 3.1.0 click 8.1.3 decorator 5.1.1 entrypoints 0.4 executing 1.2.0 Flask 2.0.3 idna 3.4 ipykernel 5.5.6 ipython 8.6.0 ipython-genutils 0.2.0 itsdangerous 2.1.2 jedi 0.18.1 Jinja2 3.1.2 jupyter_client 7.4.6 jupyter_core 5.0.0 MarkupSafe 2.1.1 matplotlib-inline 0.1.6 nest-asyncio 1.5.6 numpy 1.23.4 parso 0.8.3 pexpect 4.8.0 pgzero 1.2.1 pickleshare 0.7.5 pip 22.3.1 platformdirs 2.5.4 prompt-toolkit 3.0.32 ptyprocess 0.7.0 pure-eval 0.2.2 pygame 2.1.2 Pygments 2.13.0 python-dateutil 2.8.2 pyzmq 24.0.1 requests 2.28.2 setuptools 65.5.1 six 1.16.0 stack-data 0.6.1 tornado 6.2 traitlets 5.5.0 urllib3 1.26.14 wcwidth 0.2.5 Werkzeug 2.2.2 wheel 0.38.4 2023-03-08 08:46:03,550 - mu.virtual_environment:993(installed_packages) INFO: ['certifi', 'charset-normalizer', 'idna', 'requests', 'urllib3'] 2023-03-08 08:46:11,488 - mu.logic:1513(sync_package_state) INFO: Synchronize package states... 2023-03-08 08:46:11,489 - mu.logic:1514(sync_package_state) INFO: Old: {'requests', 'charset-normalizer', 'urllib3', 'idna', 'certifi'} 2023-03-08 08:46:11,489 - mu.logic:1515(sync_package_state) INFO: New: {'requests', 'charset-normalizer', 'json', 'urllib3', 'idna', 'certifi'} 2023-03-08 08:46:11,490 - mu.logic:1519(sync_package_state) INFO: To add: {'json'} 2023-03-08 08:46:11,490 - mu.logic:1520(sync_package_state) INFO: To remove: set() 2023-03-08 08:46:11,490 - mu.logic:1521(sync_package_state) INFO: Virtualenv: /home/bunny/.local/share/mu/mu_venv 2023-03-08 08:46:11,501 - mu.virtual_environment:967(install_user_packages) INFO: Installing user packages: json 2023-03-08 08:46:11,502 - mu.virtual_environment:152(run) INFO: About to run /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/pip with args ['install', '--disable-pip-version-check', '--upgrade', 'json'] and envvars {} 2023-03-08 08:47:25,557 - mu.logic:1152(get_dialog_directory) INFO: Using path for file dialog: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:47:28,746 - mu.interface.main:416(get_load_path) DEBUG: Getting load path: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:47:28,746 - mu.logic:1015(_load) INFO: Loading script from: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:47:28,747 - mu.logic:332(read_and_decode) DEBUG: Trying to decode with utf-8 2023-03-08 08:47:28,747 - mu.logic:335(read_and_decode) INFO: Decoded with utf-8 2023-03-08 08:47:28,748 - mu.logic:348(read_and_decode) DEBUG: Detected newline '\n' 2023-03-08 08:47:28,748 - mu.logic:1114(_load) DEBUG: import tkinter as tk from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack() entry.pack()

window.mainloop()

2023-03-08 08:47:35,374 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:47:35,397 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:47:35,397 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:47:35,397 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:47:35,397 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:47:35,398 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:47:35,398 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:47:35,398 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python38.zip', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/site-packages'] 2023-03-08 08:47:35,399 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:47:45,919 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:47:46,599 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:47:46,620 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:47:46,620 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:47:46,620 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:47:46,621 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:47:46,621 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:47:46,621 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:47:46,622 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python38.zip', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/site-packages'] 2023-03-08 08:47:46,622 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:48:04,879 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:48:05,113 - mu.logic:1223(save_tab_to_file) INFO: Saving script to: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:48:05,114 - mu.logic:1224(save_tab_to_file) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack() entry.pack()

window.mainloop()

2023-03-08 08:48:05,214 - mu.logic:1623(autosave) INFO: Autosave detected and saved changes in /home/bunny/Documents/Weirdo-Weather-Station/main.py. 2023-03-08 08:48:05,383 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:48:05,394 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:48:05,394 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:48:05,394 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:48:05,394 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:48:05,394 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:48:05,394 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:48:05,394 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python38.zip', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdiyxMJdQ/usr/lib/python3.8/site-packages'] 2023-03-08 08:48:05,394 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:49:14,563 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/session.json 2023-03-08 08:49:14,565 - mu.logic:1430(quit) INFO: Quitting.

2023-03-08 08:49:14,565 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/session.json 2023-03-08 08:49:14,566 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/venv.json 2023-03-08 08:51:29,793 - root:283(run) INFO:


Starting Mu 1.2.0 2023-03-08 08:51:29,793 - root:284(run) INFO: uname_result(system='Linux', node='bunny-Latitude-E6530', release='5.19.0-35-generic', version='#36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2', machine='x86_64', processor='x86_64') 2023-03-08 08:51:29,795 - root:285(run) INFO: Platform: Linux-5.19.0-35-generic-x86_64-with-glibc2.2.5 2023-03-08 08:51:29,795 - root:286(run) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:51:29,795 - root:287(run) INFO: Language code: en_US 2023-03-08 08:51:29,795 - mu.settings:220(load) WARNING: No settings file found at /home/bunny/.local/share/mu/settings.json; skipping 2023-03-08 08:51:29,796 - root:312(run) INFO: Wayland detected, setting QT_QPA_PLATFORM=wayland 2023-03-08 08:51:30,171 - mu.virtual_environment:619(ensure_and_create) INFO: Added log handler. 2023-03-08 08:51:30,172 - mu.virtual_environment:630(ensure_and_create) DEBUG: Checking virtual environment; attempt #1. 2023-03-08 08:51:30,172 - mu.virtual_environment:719(ensure_path) INFO: Virtual Environment found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056 2023-03-08 08:51:30,172 - mu.virtual_environment:740(ensure_interpreter) INFO: No interpreter found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:51:30,173 - mu.virtual_environment:750(ensure_interpreter) INFO: Symlinked /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python to AppImage's /tmp/.mount_Mu_EdieDghnk/usr/bin/python3.8 2023-03-08 08:51:30,173 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import sys; print("%s%s" % sys.version_info[:2])') with kwargs {'shell': False} 2023-03-08 08:51:30,232 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: 38 2023-03-08 08:51:30,232 - mu.virtual_environment:786(ensure_interpreter_version) INFO: Both interpreters at version 38 2023-03-08 08:51:30,234 - mu.virtual_environment:815(ensure_pip) INFO: Pip found at: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/pip 2023-03-08 08:51:30,238 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: pgzero 2023-03-08 08:51:30,238 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import pgzero') with kwargs {'shell': False} 2023-03-08 08:51:30,278 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:51:30,279 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: flask 2023-03-08 08:51:30,279 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import flask') with kwargs {'shell': False} 2023-03-08 08:51:30,606 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:51:30,607 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: ipykernel 2023-03-08 08:51:30,607 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import ipykernel') with kwargs {'shell': False} 2023-03-08 08:51:31,245 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:51:31,246 - mu.virtual_environment:798(ensure_key_modules) DEBUG: Verifying import of: ipython_genutils 2023-03-08 08:51:31,246 - mu.virtual_environment:463(run_subprocess) INFO: Running ('/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '-c', 'import ipython_genutils') with kwargs {'shell': False} 2023-03-08 08:51:31,296 - mu.virtual_environment:475(run_subprocess) DEBUG: Process returned 0; output: No output received. 2023-03-08 08:51:31,296 - mu.virtual_environment:662(ensure_and_create) INFO: Valid virtual environment found at /home/bunny/.local/share/mu/mu_venv-38-20230307-205056 2023-03-08 08:51:31,296 - mu.settings:169(save) DEBUG: Saving to /home/bunny/.local/share/mu/venv.json 2023-03-08 08:51:31,319 - mu.logic:777(init) INFO: Setting up editor. 2023-03-08 08:51:31,327 - mu.logic:801(init) INFO: Log directory: /home/bunny/.cache/mu/log 2023-03-08 08:51:31,328 - mu.logic:802(init) INFO: Data directory: /home/bunny/.local/share/mu 2023-03-08 08:51:31,328 - mu.logic:816(setup) INFO: Available modes: python, snek, circuitpython, microbit, esp, web, pyboard, debugger, pygamezero, lego, pico 2023-03-08 08:51:31,329 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:51:31,442 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:51:31,442 - mu.logic:1583(change_mode) INFO: Workspace directory: /home/bunny/mu_code 2023-03-08 08:51:31,442 - mu.logic:890(restore_session) DEBUG: <SessionSettings from /home/bunny/.local/share/mu/session.json> 2023-03-08 08:51:31,454 - mu.logic:1015(_load) INFO: Loading script from: /home/bunny/Documents/Weirdo-Weather-Station/weather.py 2023-03-08 08:51:31,454 - mu.logic:332(read_and_decode) DEBUG: Trying to decode with utf-8 2023-03-08 08:51:31,454 - mu.logic:335(read_and_decode) INFO: Decoded with utf-8 2023-03-08 08:51:31,455 - mu.logic:348(read_and_decode) DEBUG: Detected newline '\n' 2023-03-08 08:51:31,455 - mu.logic:1114(_load) DEBUG: # weather.py: Contains all the important weather-accessing stuff. import requests import json

api_key = "32244071f3e58861bea8ab0d64ef14b5"

"Base" URL to initialize with

base_url = "http://api.openweathermap.org/data/2.5/weather?"

class Weather: def init(self, city): self.city = city

# Gets the city and all relevant API info
def getCity(self, city_name):
    city_name = self.city

    # Finish the URL
    complete_url = base_url + "appid=" + api_key + "&q" + city_name

    # Send URL to API
    response = requests.get(complete_url)

    # Results come back in json
    result = response.json()

    # Make sure API is up
    if result["cod"] != 404:
        main = result["main"]

        # Get current temperature
        current_temp = main["temp"]

        # Convert it to fahrenheit from kelvin
        current_temperature = round((current_temp - 273.15) * 1.8 + 32)

        return current_temperature

2023-03-08 08:51:31,573 - mu.logic:1015(_load) INFO: Loading script from: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:51:31,574 - mu.logic:332(read_and_decode) DEBUG: Trying to decode with utf-8 2023-03-08 08:51:31,574 - mu.logic:335(read_and_decode) INFO: Decoded with utf-8 2023-03-08 08:51:31,574 - mu.logic:348(read_and_decode) DEBUG: Detected newline '\n' 2023-03-08 08:51:31,574 - mu.logic:1114(_load) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack() entry.pack()

window.mainloop()

2023-03-08 08:51:31,611 - mu.logic:912(restore_session) INFO: Loaded files. 2023-03-08 08:51:31,611 - mu.logic:918(restore_session) INFO: User defined environment variables: {} 2023-03-08 08:51:31,611 - mu.logic:923(restore_session) INFO: Minify scripts on micro:bit? False 2023-03-08 08:51:31,647 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /home/bunny/mu_code from settings file 2023-03-08 08:51:31,648 - mu.logic:1583(change_mode) INFO: Workspace directory: /home/bunny/mu_code 2023-03-08 08:51:42,113 - mu.logic:1223(save_tab_to_file) INFO: Saving script to: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:51:42,113 - mu.logic:1224(save_tab_to_file) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

2023-03-08 08:51:42,279 - mu.logic:1623(autosave) INFO: Autosave detected and saved changes in /home/bunny/Documents/Weirdo-Weather-Station/main.py. 2023-03-08 08:51:42,549 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:51:42,561 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:51:42,561 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:51:42,561 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:51:42,561 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:51:42,561 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:51:42,562 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:51:42,562 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:51:42,562 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:51:49,649 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:51:50,049 - mu.logic:1223(save_tab_to_file) INFO: Saving script to: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:51:50,049 - mu.logic:1224(save_tab_to_file) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack() entry.pack()

window.mainloop()

2023-03-08 08:51:50,468 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:51:50,488 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:51:50,489 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:51:50,489 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:51:50,489 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:51:50,489 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:51:50,490 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:51:50,490 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:51:50,490 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:53:46,388 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:53:46,772 - mu.logic:1223(save_tab_to_file) INFO: Saving script to: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:53:46,772 - mu.logic:1224(save_tab_to_file) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack()

entry.pack()

window.mainloop()

2023-03-08 08:53:46,903 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:53:46,923 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:53:46,924 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:53:46,924 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:53:46,924 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:53:46,924 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:53:46,925 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:53:46,925 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:53:46,925 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:53:48,004 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:53:50,444 - mu.logic:1223(save_tab_to_file) INFO: Saving script to: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:53:50,444 - mu.logic:1224(save_tab_to_file) DEBUG: import tkinter as tk

from weather import *

window = tk.Tk() window.title("Wacky Weather Station: Hacky Prototype Edition") window.geometry("740x640")

label = tk.Label(text="Enter a City") entry = tk.Entry(bg="lightgrey", width=50)

label.pack()

entry.pack()

window.mainloop()

2023-03-08 08:53:50,577 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:53:50,597 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:53:50,598 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:53:50,598 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:53:50,598 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:53:50,598 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:53:50,599 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:53:50,599 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:53:50,599 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:53:51,620 - mu.modes.python3:257(stop_script) DEBUG: Stopping script. 2023-03-08 08:56:21,438 - mu.modes.python3:230(run_script) INFO: About to run script: {'interpreter': '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', 'script_name': '/home/bunny/Documents/Weirdo-Weather-Station/main.py', 'working_directory': '/home/bunny/Documents/Weirdo-Weather-Station', 'interactive': True, 'envars': {}} 2023-03-08 08:56:21,453 - mu.interface.main:780(add_python3_runner) INFO: About to start_process: '/home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python', '/home/bunny/Documents/Weirdo-Weather-Station/main.py', '/home/bunny/Documents/Weirdo-Weather-Station', True, False, None, {}, None 2023-03-08 08:56:21,454 - mu.interface.panes:1073(start_process) INFO: Running script: /home/bunny/Documents/Weirdo-Weather-Station/main.py 2023-03-08 08:56:21,454 - mu.interface.panes:1074(start_process) INFO: Using interpreter: /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/python 2023-03-08 08:56:21,454 - mu.interface.panes:1076(start_process) INFO: Running with interactive mode. 2023-03-08 08:56:21,454 - mu.interface.panes:1079(start_process) INFO: Command args: [] 2023-03-08 08:56:21,454 - mu.interface.panes:1101(start_process) INFO: Working directory: /home/bunny/Documents/Weirdo-Weather-Station 2023-03-08 08:56:21,454 - mu.interface.panes:1105(start_process) INFO: Python path: ['/tmp/.mount_Mu_EdieDghnk/usr/lib/python38.zip', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/lib-dynload', '/tmp/.mount_Mu_EdieDghnk/usr/lib/python3.8/site-packages'] 2023-03-08 08:56:21,455 - mu.interface.panes:1135(start_process) INFO: Args: ['-i', '/home/bunny/Documents/Weirdo-Weather-Station/main.py'] 2023-03-08 08:57:16,897 - mu.logic:1439(show_admin) INFO: Showing admin with logs from /home/bunny/.cache/mu/log/mu.log 2023-03-08 08:57:16,898 - mu.virtual_environment:984(installed_packages) INFO: Discovering installed third party modules in venv. 2023-03-08 08:57:16,899 - mu.virtual_environment:139(run_blocking) INFO: About to run blocking /home/bunny/.local/share/mu/mu_venv-38-20230307-205056/bin/pip with args ['list', '--disable-pip-version-check'] and envvars {} 2023-03-08 08:57:17,638 - mu.virtual_environment:189(wait) DEBUG: Finished: True; exitStatus 0; exitCode 0 2023-03-08 08:57:17,639 - mu.virtual_environment:274(run) DEBUG: Process output: Package Version


asttokens 2.1.0 backcall 0.2.0 certifi 2022.12.7 charset-normalizer 3.1.0 click 8.1.3 decorator 5.1.1 entrypoints 0.4 executing 1.2.0 Flask 2.0.3 idna 3.4 ipykernel 5.5.6 ipython 8.6.0 ipython-genutils 0.2.0 itsdangerous 2.1.2 jedi 0.18.1 Jinja2 3.1.2 jupyter_client 7.4.6 jupyter_core 5.0.0 MarkupSafe 2.1.1 matplotlib-inline 0.1.6 nest-asyncio 1.5.6 numpy 1.23.4 parso 0.8.3 pexpect 4.8.0 pgzero 1.2.1 pickleshare 0.7.5 pip 22.3.1 platformdirs 2.5.4 prompt-toolkit 3.0.32 ptyprocess 0.7.0 pure-eval 0.2.2 pygame 2.1.2 Pygments 2.13.0 python-dateutil 2.8.2 pyzmq 24.0.1 requests 2.28.2 setuptools 65.5.1 six 1.16.0 stack-data 0.6.1 tornado 6.2 traitlets 5.5.0 urllib3 1.26.14 wcwidth 0.2.5 Werkzeug 2.2.2 wheel 0.38.4 2023-03-08 08:57:17,640 - mu.virtual_environment:993(installed_packages) INFO: ['certifi', 'charset-normalizer', 'idna', 'requests', 'urllib3']

carlosperate commented 1 year ago

Hi @dconover23

Can you post a minimal example Python script to trigger this error? Emphasis in minimal, please strip the code to the bare minimun that will cause the error, otherwise it'll be really hard for us look into it.

dconover23 commented 1 year ago

@carlosperate

I couldn't find a way to post .py files on Github so here it is in plaintext:

import tkinter as tk

window = tk.Tk()

window.title("Crash")

entry = tk.Entry(window)

The "entry = tk.Entry(window)" line causes the issue.

carlosperate commented 1 year ago

Thanks @dconover23! ( I hope you don't mind I edited your message to format the code with markdown).

The programme doesn't crash for me in macOS, next step would be to test it in Ubuntu 22.04. Are you running Mu via the AppImage? Or did you installed it a different way?

dconover23 commented 1 year ago

@carlosperate

It's being run using the AppImage, yeah.