-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
3.10.8 IDLE startup failure: No module named 'test' #98324
Comments
Please describe what you did and what happened. Please be precise, it's not enough to say you tried "everything" and "still boom idle is not opening". What did you do? Double-click a file, type a command at the command prompt, use the Windows start menu, something else? Give us the exact steps please. What happened then? Did you get an error? Can you copy and paste the error, or if not possible, take a screenshot? What is your environment? Trust me, you did not try "almost every env". What version of Windows are you running? Did you try temporarily disabling any anti-virus? How many versions of Python do you have? Did you install 3.9 and 3.11 from the Windows app store too? |
here is a video |
Confirming this issue. Today noticed exactly the same problem: can't start IDLE anymore from the Start menu, no error, no anything. In the Start menu I click on "IDLE (Python 3.10)" entry and nothing happens. Can't say when was the last time I ran IDLE, maybe a week or couple ago, noticed this problem only today when tried to launch it. OS - Windows 10 Pro 21H2 (OS Build 19044.2130) Python 3.10.8 was released on 2022-10-11 according to the announcement. I don't know when it arrived to Microsoft Store, maybe couple days later. So maybe this bug/issue was introduced in 3.10.8 version. Console version of Python from Command Prompt runs fine:
Executing
Also similar output when running
|
This issue is fixed for future releases by #98313. The problem is that #97530 fixed IDLE tests possibly crashing on a Mac without a GUI. But it resulted in IDLE not starting in 3.10.8, 3.12.0a1, and Microsoft Python 3.10.2288.0 when tests are not installed. After this patch, test.* is only imported when testing on Mac, which test.* must exist. Fix 1: edit Lib/idlelib/macosx.py by making line 7 a comment and replacing line 23 with from os.path import expanduser
import plistlib
from sys import platform # Used in _init_tk_type, changed by test.
# from test.support import requires, ResourceDenied # <- line 7 now a comment
import tkinter
## Define functions that query the Mac graphics type.
## _tk_type and its initializer are private to this section.
_tk_type = None
def _init_tk_type():
""" Initialize _tk_type for isXyzTk functions.
"""
global _tk_type
if platform == 'darwin':
try:
pass # <- line 23 replacement
except ResourceDenied: # Possible when testing.
_tk_type = "cocoa" # Newest and most common. Alternatively, delete line 7 and the 4-line try-except block lines 22-25. Note that the path may be slightly different before Edit: 3.11.0, without the bug, was released today. The PSF python.org Windows installer installs test/* by default. An alternate fix for someone who changed the default is to re-run the installer, select Modify, reselect 'Install tests', and click the install/continue/whatever button. AFAIK, the PSF python.org Mac installer always installs test/*. I don't know what *nix distributions do, but there should be an option to install tests if not the default. |
This is our package, and I update it as part of doing the regular releases. So it'll get any updates at the same time (plus review by Microsoft Store team, which is typically only a day or two). There's no option to include the test suite, and I don't really want to double the install size by adding it in. We shouldn't have dependencies on the test suite from the main stdlib code. |
Thanks; I edited the Store part of my answer above. Continue omitting the test suite. The revised code only imports test on Mac and only when test.test_idle is run, when the import must succeed. |
I have a MicrosoftStore install, and I found the file in EDIT: On further investigation it appears that Windows just straight up won't let you edit files under WindowsApps, so Affected users will have to go the path of getting "test" instead... if I can work out how to get the Store to let me do that... |
@pmabbott The next release has a proper fix for this, but you can also copy the entire |
Hi another one to add to the fray, my IDLE was running up until approximately the above ticket was generated, I am curious if Python changed or an ms package changed? I will attempt to add the test package, but I have no admin rights on my machine. I will report back for other users. If ms Store can update the package asap that would be the best solution for users with no admin. |
The file I suggested editing in #98324 (comment) changed. If that is not possible, installing Python from python.org is possible for at least some people. |
The suggestion from @zooba works with a little bit of tweaking. Unfortunately, the site package path is within To summarise the workaround (Which I think does require admin rights in order to set PYTHONPATH):
|
You'll also have one under |
So rounding back on this one.. I managed to add to PYTHONPATH in CLI using the path command, with no Admin required, this solved the Path issue. (I couldn't get access to the Env Variables GUI in Advanced System Settings (CLI above solved that) and couldn't gain access to the C:\Program Files\WindowsApps folder, to place the test files without Admin privileges) I downloaded 3.10.8 windows installer direct from Python.org removed all Python installs from Windows, and installed Python 3.10.8 into the user directory (C:\Users<you>\AppData\Local\Programs\Python) unchecking the Admin privileges box. This allowed me to use IDLE again. So far all packages that I use have installed through pip with no issues. Windows 10 Pro Python 3.10.8 |
python.org got 3.11.0 yesterday |
ya it's so good |
Bug report
I tried everything possible trying it in different pc , using VMware , used it in 10, and 11 , too and still boom idle is not opening , earlier I thought the problem is in my pc but t tried everything and hence its this program problem and also I tried 3.11 and 3.9 , it works perfectly fine
Your environment
i tried it in almost every env with different pc , and hence problem might be in the software i.e. python idle
EDIT by Terry J. Reedy: This is an IDLE regression in 3.10.8. My fault. See #98324 (comment) below for the fixes.
The text was updated successfully, but these errors were encountered: