Python Forum

Full Version: Python Idle won't start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Output of "idle &" in terminal after garuda linux upgrade:

Error:
File "/usr/bin/idle", line 3, in from idlelib.pyshell import main File "/usr/lib/python3.10/idlelib/pyshell.py", line 53, in from idlelib import debugger File "/usr/lib/python3.10/idlelib/debugger.py", line 7, in from idlelib import macosx File "/usr/lib/python3.10/idlelib/macosx.py", line 7, in from test.support import requires, ResourceDenied ModuleNotFoundError: No module named 'test'
Do not know how to reinstall test.support package in python again. If I would know that, that will fix this issue.
(Oct-14-2022, 04:12 PM)totalmachine Wrote: [ -> ]@Yoriz write 18 minutes ago:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.


There's no programming code, it's Python Idle (Tool) which can't be started after upgrade of my linux distribution. If I would know where I can find python test package, which is missing, which also has support (test.support) package, this problem would be solved. I can't find and install any python package by name test so I suppose test package is contained in other package or it can be found under different name than test. Thx in advance.
try to install python3-testresources
(Oct-14-2022, 05:16 PM)Axel_Erfurt Wrote: [ -> ]try to install python3-testresources

I tried, but Garuda linux is archlinux based. So I tried three options:

1) pip install python3-testresource:

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement python3-testresource (from versions: none)
ERROR: No matching distribution found for python3-testresource

2) sudo pacman -Syy python3-testresources:

Synchronising package databases...
garuda 94,8 KiB 19,5 KiB/s 00:05 [------------------------------------] 100%
core 156,4 KiB 91,4 KiB/s 00:02 [------------------------------------] 100%
extra 1721,4 KiB 369 KiB/s 00:05 [------------------------------------] 100%
community 7,0 MiB 731 KiB/s 00:10 [------------------------------------] 100%
multilib 169,7 KiB 115 KiB/s 00:01 [------------------------------------] 100%
chaotic-aur 2,3 MiB 156 KiB/s 00:15 [------------------------------------] 100%
error: target not found: python3-testresources

3) pip install testresources

Defaulting to user installation because normal site-packages is not writeable
Collecting testresources
Downloading testresources-2.0.1-py2.py3-none-any.whl (36 kB)
Collecting pbr>=1.8
Downloading pbr-5.10.0-py2.py3-none-any.whl (112 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.4/112.4 kB 337.4 kB/s eta 0:00:00
Installing collected packages: pbr, testresources
Successfully installed pbr-5.10.0 testresources-2.0.1

but after I started: idle & in terminal I got same response as I had it before I installed testresources. It should be other package.
Anything new?
Do this from command line and post output.
python3- V
python- V
which python3
which python

pip -V
pip3 -V

# Try start Idle like this
python3 -m idlelib
Problem try to do new install
How to Install IDLE Python
Don't know pacman package manager deal with have to search for that.

IDLE is not good,unfortunately so has Python not address this problem it has been up for debate many times.
Usually only beginner that use IDLE before they find something better.
(Oct-15-2022, 05:43 PM)snippsat Wrote: [ -> ]Do this from command line and post output.
python3- V
python- V
which python3
which python

pip -V
pip3 -V

# Try start Idle like this
python3 -m idlelib
Problem try to do new install
How to Install IDLE Python
Don't know pacman package manager deal with have to search for that.

IDLE is not good,unfortunately so has Python not address this problem it has been up for debate many times.
Usually only beginner that use IDLE before they find something better.

After I run:

python3 -m idlelib

I got almost same response:

Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/idlelib/__main__.py", line 6, in <module>
import idlelib.pyshell
File "/usr/lib/python3.10/idlelib/pyshell.py", line 53, in <module>
from idlelib import debugger
File "/usr/lib/python3.10/idlelib/debugger.py", line 7, in <module>
from idlelib import macosx
File "/usr/lib/python3.10/idlelib/macosx.py", line 7, in <module>
from test.support import requires, ResourceDenied
ModuleNotFoundError: No module named 'test'

Python3 version:

$python3 -V
Output:
Python 3.10.8

Python version:

$python -V
Output:
Python 3.10.8

Pip3 version:

$pip3 -V
Output:
pip 22.2.2 from /home/marko/.local/lib/python3.10/site-packages/pip (python 3.10)
Pip version:

$pip -V
Output:
pip 22.2.2 from /home/marko/.local/lib/python3.10/site-packages/pip (python 3.10)

Which command:

$which python3
Output:
/usr/bin/python3

Which command:

$which python
Output:
/usr/bin/python


I use IDLE as interpreter only to test small part of programming code, otherwise I'm using code (visual studio for Linux).

I saw that regression test package, which is missing and it's absence causes problems, is a part of Python Standard Library and that Python Standard Library can't be upgraded because it is linked to current python version in general and it's not python extension. So probably, issue with IDLE will be fixed when new version of python will come.
In file /usr/lib/python3.10/idlelib/macosx.py
Comment out line line 7 and save.
#from test.support import requires, ResourceDenied
See if Idle will start now.
(Oct-16-2022, 12:05 AM)snippsat Wrote: [ -> ]In file /usr/lib/python3.10/idlelib/macosx.py
Comment out line line 7 and save.
#from test.support import requires, ResourceDenied
See if Idle will start now.

I can try it, but that will cause problems because you import something in file because you want to use that in that file. Wherever ResourceDenied occurs in file, if that line is commented will be bug. So, rather I will download python 3.10.7 version and then I will with vitualenv change default version to that mentioned version and then IDLE will work. Otherwise it will be needed to wait for new version of python 3.10.9 because current python standard library can't be upgraded and regression test package is part of it, as it said before in one my previous comment.
I found a solution:

I downloaded python 3.10.8 from:

https://www.python.org/downloads/release/python-3108/

I extracted .xz file in /home/totalmachine/Downloads/Packages/Python and did this:

sudo cp -r /home/totalmachine/Downloads/Packages/Python/Python-3.10.8/Lib/test /usr/lib/python3.10/test

When I started IDLE after that, there were no problems anymore.