From castelpachi123 at gmail.com Mon Sep 5 06:42:15 2022 From: castelpachi123 at gmail.com (Francisco Castel) Date: Mon, 5 Sep 2022 07:42:15 -0300 Subject: [Idle-dev] Strange Error Message-ID: ---------------------------------------- Unhandled exception in user code execution server!' Thread: SockThread IDLE Client Address: ('127.0.0.1', 50654) Request: Traceback (most recent call last): File "G:\Python\lib\socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "G:\Python\lib\socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "G:\Python\lib\socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "G:\Python\lib\idlelib\rpc.py", line 514, in __init__ socketserver.BaseRequestHandler.__init__(self, sock, addr, svr) File "G:\Python\lib\socketserver.py", line 747, in __init__ self.handle() File "G:\Python\lib\idlelib\run.py", line 532, in handle import pydoc # import must be done here to capture i/o binding File "G:\Python\lib\pydoc.py", line 73, in import urllib.parse File "G:\Python\urllib.py", line 1, in import urllib.request ModuleNotFoundError: No module named 'urllib.request'; 'urllib' is not a package *** Unrecoverable, server exiting! Users should never see this message; it is likely transient. If this recurs, report this with a copy of the message and an explanation of how to make it repeat. ---------------------------------------- ---------------------------------------- Unhandled exception in user code execution server!' Thread: SockThread IDLE Client Address: ('127.0.0.1', 50654) Request: ================================ RESTART: Shell ================================ Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. ---------------------------------------- Unhandled exception in user code execution server!' Thread: SockThread IDLE Client Address: ('127.0.0.1', 50654) Request: Traceback (most recent call last): File "G:\Python\lib\socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "G:\Python\lib\socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "G:\Python\lib\socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "G:\Python\lib\idlelib\rpc.py", line 514, in __init__ socketserver.BaseRequestHandler.__init__(self, sock, addr, svr) File "G:\Python\lib\socketserver.py", line 747, in __init__ self.handle() File "G:\Python\lib\idlelib\run.py", line 532, in handle import pydoc # import must be done here to capture i/o binding File "G:\Python\lib\pydoc.py", line 73, in import urllib.parse File "G:\Python\urllib.py", line 1, in import urllib.request ModuleNotFoundError: No module named 'urllib.request'; 'urllib' is not a package *** Unrecoverable, server exiting! Users should never see this message; it is likely transient. If this recurs, report this with a copy of the message and an explanation of how to make it repeat. ---------------------------------------- Hi, im doing a Python course in freecodecamp.org and just run the next example code from https://www.py4e.com/code3/ on IDLE: import urllib.request fhand = urllib.request.urlopen('http://data.pr4e.org/romeo.txt') for line in fhand: print(line.decode().strip()) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Mon Sep 5 13:25:07 2022 From: tjreedy at udel.edu (Terry Reedy) Date: Mon, 5 Sep 2022 13:25:07 -0400 Subject: [Idle-dev] Strange Error In-Reply-To: References: Message-ID: <90df02b4-14f3-6cd8-181f-bf4516cd0546@udel.edu> On 9/5/2022 6:42 AM, Francisco Castel wrote: > ---------------------------------------- > Unhandled exception in user code execution server!' > File "G:\Python\lib\socketserver.py", line 747, in __init__ > self.handle() > File "G:\Python\lib\idlelib\run.py", line 532, in handle > import pydoc # import must be done here to capture i/o binding > File "G:\Python\lib\pydoc.py", line 73, in > import urllib.parse This should import G:\Python\lib\urllib\parse > File "G:\Python\urllib.py", line 1, in But it got urllib not in ...\lib. This must be a file you added with the same 'urllib' name. Change the name. > import urllib.request > ModuleNotFoundError: No module named 'urllib.request'; 'urllib' is not a > package Because it is not the python stdlib package in G:\Python\lib -- Terry Jan Reedy From shurow2009 at gmail.com Tue Sep 6 14:20:40 2022 From: shurow2009 at gmail.com (Vektoriuxx) Date: Tue, 6 Sep 2022 21:20:40 +0300 Subject: [Idle-dev] (no subject) Message-ID: Hello. I just got a little problem. Answer me please, how can I run script in app named IDLE? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Wed Sep 7 11:36:08 2022 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 7 Sep 2022 11:36:08 -0400 Subject: [Idle-dev] (no subject) In-Reply-To: References: Message-ID: On 9/6/2022 2:20 PM, Vektoriuxx wrote: > Hello. I just got a little problem. Answer me please, how can I run > script in app named IDLE? Load the script in an IDLE editor and hit F5. Please read the doc at https://docs.python.org/3/library/idle.html. Note that IDLE is meant for learning Python and developing scripts, not so much for running them. -- Terry Jan Reedy