Skip to content

Tkinter import sometimes fails in 3.13.0 #128188

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

Closed
noblockhit opened this issue Dec 22, 2024 · 17 comments
Closed

Tkinter import sometimes fails in 3.13.0 #128188

noblockhit opened this issue Dec 22, 2024 · 17 comments

Comments

@noblockhit
Copy link

noblockhit commented Dec 22, 2024

The failiure of the tkinter import on 3.13.0 is still undocumented / not mentioned in the patch notes of 3.13.1 or even better: the download option here:
https://www.python.org/downloads/#:~:text=Release%20Notes-,Python%203.13.0,-Oct.%207%2C%202024
should be repackaged, so that tkinter actuall works.

@noblockhit noblockhit added the docs Documentation in the Doc dir label Dec 22, 2024
@picnixz
Copy link
Member

picnixz commented Dec 22, 2024

Please add more details. What is the error? what are you trying to do? what is missing exactly? which operating system are you using?

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Dec 22, 2024
@noblockhit
Copy link
Author

Sorry, clicked enter too early, post was edited to the intended content.

@picnixz
Copy link
Member

picnixz commented Dec 22, 2024

My question remains: what is the exact issue? when you say "cannot import tkinter", is it just import tkinter that is failing? how are you building Python? what is your operating system?

@picnixz picnixz removed the docs Documentation in the Doc dir label Dec 22, 2024
@noblockhit
Copy link
Author

As mentioned here: #125235 The tkinter library was improperly packaged or something alike on 3.13.0. For me, it also fails when importing tkinter regularly in a free threaded environment. I get no error message, python just silently quits when i try importing tkinter like this: import tkinter. I did not compile python myself, i just downloaded it from the link i pasted in the post body.

@picnixz
Copy link
Member

picnixz commented Dec 22, 2024

Have you tried downloading 3.13.1 instead of 3.13.0 (https://www.python.org/downloads/release/python-3131/)? if there's a bug in a previous version, we don't re-upload a corrected version.

@noblockhit
Copy link
Author

Yes I did, but I am having trouble installing other 3rd party modules like rawpy and opencv-python because there are either no compatible versions yet, or deprecated functions in use like ImpImporter from pkgutils in the case of opencv-python

@picnixz
Copy link
Member

picnixz commented Dec 22, 2024

I'm afraid we can't do anything. We may perhaps try to see if we can include it in 3.13.0 and republish it but this is left to the RM @Yhg1s. I think this needs to be closed as wont fix unfortunately =/

The best shot for you is to use 3.12.X instead.

@Yhg1s
Copy link
Member

Yhg1s commented Dec 23, 2024

Yes, there's nothing we can do for 3.13.0. The fix is in 3.13.1. If something is stopping you from using 3.13.1 instead of 3.13.0, that's a separate issue that should be looked at (but that wouldn't change the fact that we cannot retroactively fix 3.13.0.)

@noblockhit
Copy link
Author

Ok, but it is still not entirely clear to me why the 3.13.0 version cant be overridden. It wouldn't really introduce new functionality or fix a real bug, which is of course supposed to go into a new patch like 3.13.1, but just an error in the packaging process. I don't see any downsides in simply changing the file.
If there is strict policy against that, for whatever reason, it should at very least be documented that the tkinter module is missing and there should be a warning on the download page, as it doesn't work correctly.

@terryjreedy terryjreedy changed the title Missing tkinter in 3.13.0 install Tkinter import sometimes fails in 3.13.0 Dec 23, 2024
@terryjreedy
Copy link
Member

I changed the title because it was wrong. Tkinter was present in the 3.13.0 release. It worked fine with a default install and usage, but not in other situations. This was reported and as far as we know fixed in #125235.

3.13 is the most recent version of Python. 3.13.0 was the first release thereof. Each release represents a tagged version our github git repository. The general policy on PyPI is to increment release numbers for each new release, and we follow that.

The fix for this issue was a one-word replacement in _tkinter.c. The 3.13.1 release contains this patch; it is the replacement for 3.13.0. The reasons to not use a bugfix release/replacement are for historical research or because a previous release works and one worries or knows that it will break something along with the fixes.

Unreported issues with 3rd party packages should be referred to their maintainers.

@noblockhit
Copy link
Author

For the record, tkinter didn't work for me on 3.13.0 at all.
Nevertheless, my question stands: Why is it not documented that tkinter is broken on 3.13.0. The least that should happend is a little note on the download page that tkinter doesn't work properly, nothing more, nothing less.

@Yhg1s
Copy link
Member

Yhg1s commented Dec 23, 2024

Tkinter does work for a significant majority of users. We can't replace the 3.13.0 version with a new release with the same version number because it would create unacceptable confusion as to which 3.13.0 someone has. The fixed release is 3.13.1. Use 3.13.1.

@noblockhit
Copy link
Author

Please read my comment carefully:

  1. There is no warning on the download page or patch notes of 3.13.0 or 3.13.1 that tkinter is not working. I am (at this point) only asking for a comment on the docs and/or download page to warn users.
  2. I know nobody who got tkinter working on 3.13.0 myself, so I'd consider it a failed release

Please answer all my concerns, not just the low-hanging-fruit

@terryjreedy terryjreedy removed the pending The issue will be closed if no feedback is provided label Dec 24, 2024
@terryjreedy
Copy link
Member

@noblockhit Enough. Reread existing answers if you do not understand.
CPython releases are free gift, with much volunteer effort. Please let us work on remaining bugs.

  1. We do not list bugs on the download pages and will not start doing so.
  2. I and others used tkinter on 3.13.0 and 3.13.1 and all other releases.

@noblockhit
Copy link
Author

@terryjreedy I'd be greatly pleased if you could explain how you got tkinter to work on your machine using 3.13.0.

@terryjreedy
Copy link
Member

The same as usual for about 20 years. I went to the 3.13.0 release page and downloaded the Windows 64 bit installer. I ran it, making sure that '[x] install tkinter and IDLE' was checked. (I believe I also checked '[x] all users', but I hope that this is not relevant). I ran IDLE and it worked.

@noblockhit
Copy link
Author

I did the same but python silently quits after importing tkinter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants