Tkinter crashing - python

I've been using tkinter in a python program that I've been working on, and up until today the program was running correctly, but now on running the program without changing any code my computer restarts after responding to the first tkinter window. Running python -m tkinter in the terminal also crashes.
I completely uninstalled and reinstalled anaconda (version 4.7.10)and python (version 3.7.3) and nothing has changed. This is on macOS 10.14.6.
The error message "Class FIFinderSyncExtensionHost is implemented in both ... and ... One of the two will be used. Which one is undefined." also displays when the program is run, but I'm not sure if this is a related issue.

MacOS 10.14.6 update causes my MacBook Air to restart when I execute the a Tkinter python script. Worked fine before that. Must be an Apple problem. Even the simplest of scripts causes a catastrophic crash/restart.

Related

Spyder IDE with python 3.10 seems freezing when click run button, but it works fine if run a single line beforehand running the entire script

I have truble with last version of Spyder 5.4.0 with last version of Python 3.10.6.
Spyder version: 5.4.0 (conda)
Python version: 3.10.6 64-bit
Qt version: 5.15.2
PyQt5 version: 5.15.7
Operating System: Windows 10
Even if running a script like
print('Hello world')
when I click on the play green button, the IPython console seems freezing on this script, and it does not run for hours.
If I select this line of code and I run current selection or run the current cell it works fine. From this moment, it seems that spyder works fine, until at a certain point when I run it seems again freezing. I have to restart a new console and before running the script I have to run a single line or a single cell.
It seems that I have to 'activate' in someway the Python console in order to Spyder will run the script.
Does anyone have the same issue? How can I solve it?
I have tried to uninstall and reinstall both spyder and python many times, but it is useless.
After many trials, I noticed that there is something strange with IPython console. I noticed that when it hangs after running a code, if I delete all user variables, it worked fine.
Then I tryed to delete all variables before execution, and it work fine.
Therefore I discovered that a solution that worked for me is to go to preferences -> Run -> and untick the option 'Remove all variables before execution'
It is quite annoying because I have to do it manually every time before running, but in this way the spyder does not appear to hang anymore! I hope that the Spyder developers will solve it soon.
-
I automatically solved by typing at the beginning of any script these lines, inspired from the question Code to clear console and variables in Spyder :
try:
from IPython import get_ipython
get_ipython().magic('clear')
get_ipython().magic('reset -f')
import matplotlib.pyplot as plt
plt.close('all')
except:
pass
similar to Matlab in which you normally start your code with
clc
close all
clear all

Python 3.10 IDLE does not respond everytime I hit configure IDLE from options

I am a Windows 10 user, and had configured the Python 3.10 IDLE to dark mode and had added the Fira Code font to the IDLE a few days back (Through the Options menu). Then the Python IDLE was working fine; without issues.
However, each time after that when I try to go to 'Configure IDLE' from Options Menu, Python IDLE just freezes and then stops responding, until I manually close it. It then asks to run a Windows check and reports the error to Windows. I have tried uninstalling and reinstalling Python; however that did not work.
Image: Python has stopped responding (happens everytime I click on configure IDLE)
I am a Windows user and tried running python from cmd using the command: py -m idlelib to start IDLE from the command line to try and get an error report, however the same problem happens as mentioned above, and I do not get an error report when I close Python. I tried finding solutions in similar questions, however I did not understand what was going on. I also do not seem to figure out how 'running the Python IDLE' through the command line works, other than running it using the above command. Can someone please assist me on what to do next at this point, that would be of huge help :D
Try uninstalling the font. The Doesn't work part of the Editor compatibility list on https://github.com/tonsky/FiraCode includes IDLE. I suspect that the font is incompatible with tcl/tk. Your report is similar to
IDLE Settings window won't appear
See https://bugs.python.org/issue45103 for so far futile efforts to protect IDLE.
UPDATE: We were not able to reproduce the problem with FireCode. However, the BPO issue referenced above lead to a tcl/tk bug report that lead to a bugfix, at least for the Phaistos font, that is included in tcl/tk 8.6.12. This is included in the new Python 3.9.9 Windows installer and will be in the upcoming 3.10.1 installer. It might fix your issue with FiraCode.

How to get Pygame script to run on macOS

I have a rather small Pygame based python script and I just bought a Mac so I'm trying to run my script on here. Everything has been installed correctly (Checking by typing 'import Pygame') into python terminal as-well as running a basic hello world program. However, when I try running this script, IDLE gets brought to the front but nothing happens from there. (The script is supposed to pop-up a new window). Is this a problem with my installations or my code? (Code works on windows setup).
You could try to run the script again on a windows computer to see if you forgot to save some changes or if the file got corrupted somehow. You could also use bootcamp to install Windows on your mac since you could have one windows version on your mac for coding purposes and the regular mac OS for other stuff if you like.
you can execute it by left clicking in your script and select open with python launcher

blank window after clicking run module in VIDLE

I just started learning vPython for my physics project. I was trying out some simple code from the visual library and everything ran great for the first half an our but after I close vPython completely and restarted it my test application doesn't "run" anymore. It shows a blank window and whenever I try to interact with it it shows "not responding". I'm running Windows 10 Pro 64bit with 64-bit Python-2.7.9 and VPython-Win-64-Py2.7-6.11 from vPython.org. I've tried rebooting my computer and reinstalling both Python and vPython but nothing helps. I then transfered my projects to my MacBook Pro and everything runs perfectly. Is there any solution for this? Thank you.
Have you tried unistalling and then re-installing Python? I know it's not the most professional answer, but...

IDLE 3.4.3 crashes when running module

I've recently started to use Python, and I don't know much about programming.
I've installed Python 3.4.3 in my Mac OS X Yosemite, and it worked fine for a few months, but now every time I want to run a module it stops responding.
so I use IDLE and when I open a new file to define a function I can write, then I click run and I save my file, and then when I click save IDLE doesn't restart as it use to and I can't write on it or do anything else. there is no crash report, no nothing, just all frozen. I close it and if then I re open and write on IDLE it works but as soon as I try to run a new file again it freezes.
How can I solve it?
to try stuff out i've been using repl.it online and it is useful for a learner like me but still I would like to be able to use IDLE on my mac.
THANK YOU FOR YOUR HELP!!!!
Try using Anaconda, which is another Python distribution, but more science-oriented. It has all the commonly required modules already in it (plus other for scientific purposes), so that you don't have to install them as and when required. And when you install Anaconda, it automatically installs Spyder, which is a much better IDE than IDLE.

Categories

Resources