I can't seem to get python IDLE to work

I’m trying to get my python IDLE to work but it isn’t working. I keep getting this error when I run it:

Traceback (most recent call last):
File “/usr/bin/idle”, line 5, in
main()
File “/usr/lib/python3.8/idlelib/pyshell.py”, line 1477, in main
root = Tk(className=“Idle”)
File “/usr/lib/python3.8/tkinter/init.py”, line 2261, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: unknown color name “BACKGROUND”

Any ideas guys?

How did you run IDLE?

I can’t reproduce that, it opens the shell window just fine.

Are you up to date?

sudo pacman-mirrors -f5 && sudo pacman -Syyu

I just typed “idle” in the terminal. I also tried “idle 2.7” and “idle 3.8” to no avail.

Edit: “idle3” doesn’t work either.

Well it’s a fresh install and the system said it was updated. I ran your code anyways though, and everything seems okay:

:INFO Downloading mirrors from repo.manjaro
::INFO Using custom mirror file
::INFO Querying mirrors - This may take some time
2.239 United_States : ttps://mirror.dacentec.com/manjaro/
1.848 United_States : ttps://us.mirrors.fossho.st/manjaro/
1.275 United_States : ttp://us.mirrors.fossho.st/manjaro/
2.600 United_States : ttps://repo.ialab.dsu.edu/manjaro/
0.904 United_States : ttp://repo.ialab.dsu.edu/manjaro/
1.738 United_States : ttps://mirrors.gigenet.com/manjaro/
0.496 United_States : ttp://mirrors.gigenet.com/manjaro/
0.652 United_States : ttp://distro.ibiblio.org/manjaro/
::INFO Writing mirror list
::United_States : ttps://mirrors.gigenet.com/manjaro/stable/$repo/$arch
::United_States : ttp://distro.ibiblio.org/manjaro/stable/$repo/$arch
::United_States : ttps://repo.ialab.dsu.edu/manjaro/stable/$repo/$arch
::United_States : ttps://us.mirrors.fossho.st/manjaro/stable/$repo/$arch
::United_States : ttps://mirror.dacentec.com/manjaro/stable/$repo/$arch
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
:: Synchronizing package databases…
core 169.2 KiB 233 KiB/s 00:01 [##################] 100%
extra 2013.0 KiB 859 KiB/s 00:02 [##################] 100%
community 6.2 MiB 1219 KiB/s 00:05 [##################] 100%
multilib 194.3 KiB 5.75 MiB/s 00:00 [##################] 100%
:: Starting full system upgrade…
there is nothing to do

The problem remains, however. It’s particularly strange because this is the second time I’m installing this version of Manjaro (20.1) and there weren’t any issues with this the first time around.

Note: I removed all the h’s from the links because the I’m not allowed to post links apparently. I also removed the .org from repo.manjaro.

Do I have to do a reinstall?

Well, what did you do differently this time?

I ran it the same way tbh. I had to reinstall because of some Grub problems, but I followed pretty much the same steps. I used the GUI and all. If there’s a difference, I guess it’s that this time I created a swap partition whereas I didn’t last time. The exact order by which I installed applications might also differ slightly, but I assumed Manjaro came packaged with IDLE.

Oh yes! Now that I think of it, this time I got an error related to tk when I first tried running IDLE and so I had to download it again to fix it.

Everything else is okay so far.

Yes, it’s part of the python package.

Your error does relate to tkinter. Do you have tk installed now? Are you installing your Python packages from the repos or with pip?

warning: tk-8.6.10-2 is up to date – reinstalling
resolving dependencies…
looking for conflicting packages…
Packages (1) tk-8.6.10-2
Total Installed Size: 4.75 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [###########################################################] 100%
(1/1) checking package integrity [###########################################################] 100%
(1/1) loading package files [###########################################################] 100%
(1/1) checking for file conflicts [###########################################################] 100%
(1/1) checking available disk space [###########################################################] 100%
:: Processing package changes…
(1/1) reinstalling tk [###########################################################] 100%
:: Running post-transaction hooks…
(1/1) Arming ConditionNeedsUpdate…

It seems it’s up to date as far as I can see. I install them from repositories. But I’ve only installed 3 or so (scikit, xgboost and matplotlib). Thank you for taking the time by the way.

Well, I’m out of ideas besides searching the internet. I’m also about to head to bed. Not sure if this will help, but you did mention matplotlib:

Or maybe:
Red Hat Bugzilla: Bug 1043686 - tk apps fail in KDE with unknown color name BACKGROUND

I have seen this in old forum

1 Like

Hello Yochanan. I just want to say thank you very much for your help. And I also found a solution by @antman. In case you ever meet someone with this same issue (or a similar one), you have somewhere to point to now. (I’d add a link but I don’t think I can)

Worked like magic. You’re a hooting magician!!!

The solution to the post @antman linked was also in the Red Hat Bugzilla link I posted. :wink:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.