Python Forum
Error on first Python launch
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error on first Python launch
#1
I just installed Python 3.12 and get errors in the in the Command Prompt window when launching.

Here is a cut / paste:

Microsoft Windows [Version 10.0.19045.4355]
© Microsoft Corporation. All rights reserved.

C:\Users\Owner>py
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "<frozen site>", line 450, in register_readline
File "E:\Python312\Lib\site-packages\readline.py", line 34, in <module>
rl = Readline()
^^^^^^^^^^
File "E:\Python312\Lib\site-packages\pyreadline\rlmain.py", line 422, in __init__
BaseReadline.__init__(self)
File "E:\Python312\Lib\site-packages\pyreadline\rlmain.py", line 62, in __init__
mode.init_editing_mode(None)
File "E:\Python312\Lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode
self._bind_key('space', self.self_insert)
File "E:\Python312\Lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key
if not callable(func):
^^^^^^^^^^^^^^
File "E:\Python312\Lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable
return isinstance(x, collections.Callable)
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'
>>>



I'm new to Python.
Thanks
Reply
#2
I'm guessing you tried restarting, correct?

Did you use the official windows python installer from python.org? I'd recommend trying to reinstall with that installer.
Reply
#3
Have you installed pyreadline?
If so pip uninstall pyreadline.
If not install with pip,just remove this file E:\Python312\Lib\site-packages\readline.py and try again.
readline.py is not part of Python default iinstall files,as it belong to pyreadline if look at file readline.py.
So dos it hook into low level stuff and can make this error.
Reply
#4
(May-07-2024, 06:53 AM)snippsat Wrote: Have you installed pyreadline?
If so pip uninstall pyreadline.
If not install with pip,just remove this file E:\Python312\Lib\site-packages\readline.py and try again.
readline.py is not part of Python default iinstall files,as it belong to pyreadline if look at file readline.py.
So dos it hook into low level stuff and can make this error.
Reply
#5
Thanks you snippsat. I installed Python with the download Python.org/downloads. Removing the readline.py fixed the problem.
Reply
#6
What did you install? 64-bit, ARM64, embeddable?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Launch Python IDLE Shell from terminal Pavel_47 5 1,325 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Launch Windows Application OEMS1 0 2,192 Mar-26-2021, 07:42 PM
Last Post: OEMS1
Photo Python won`t launch error newbieee 0 1,813 Feb-02-2021, 11:51 PM
Last Post: newbieee
  Launch another python command without waiting for a return. SpongeB0B 13 11,167 Jun-18-2020, 10:45 AM
Last Post: Yoriz
  win32 API: Launch Application to RDP session from background process python script rangeshgupta 0 2,197 May-28-2020, 09:41 PM
Last Post: rangeshgupta
  error message on program launch DJPY1175 0 1,785 Jun-10-2019, 08:40 AM
Last Post: DJPY1175
  [split] Python won't launch Nikmartin 1 2,350 May-12-2019, 11:58 PM
Last Post: micseydel
  Pyinstaller exe won't launch after crash kainev 0 2,653 May-11-2019, 06:06 PM
Last Post: kainev
  How to launch a program through python script - Mac OS Mojave Aurimas 2 2,865 May-11-2019, 10:20 AM
Last Post: kritesh
  launch .exe from python script in windows hary 8 59,769 Mar-21-2017, 10:25 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020