[Python] Errore all'avvio di python.

Marco Giusti marco.giusti a posteo.de
Mar 27 Set 2022 14:06:19 CEST


Buongiorno Gabriele,
   sembra che il file pyreadline/py3k_compat.py della libreria pyreadline
non sia aggiornato dal 2012. Callable fa ora parte del package
collections.abc, non collections. Disinstalla pyreadline e dovresti
essere in grado di lanciare l'interprete Python.


https://github.com/pyreadline/pyreadline/blob/master/pyreadline/py3k_compat.py



On 27.09.2022 13:10, Gabriele Battaglia wrote:
> Buongiorno.
> 
> Se chiamo l'interprete ottengo questo errore:
> 
> 
> e:\Dropbox\py>python
> 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.
> Failed calling sys.__interactivehook__
> Traceback (most recent call last):
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site.py",
> line 446, in register_readline
>     import readline
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\readline.py",
> line 34, in <module>
>     rl = Readline()
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\rlmain.py",
> line 422, in __init__
>     BaseReadline.__init__(self)
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\rlmain.py",
> line 62, in __init__
>     mode.init_editing_mode(None)
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\modes\emacs.py",
> line 633, in init_editing_mode
>     self._bind_key('space',       self.self_insert)
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\modes\basemode.py",
> line 162, in _bind_key
>     if not callable(func):
>   File
> "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\py3k_compat.py",
> line 8, in callable
>     return isinstance(x, collections.Callable)
> AttributeError: module 'collections' has no attribute 'Callable'
>>>> 
> 
> 
> Da cosa può dipendere?



Maggiori informazioni sulla lista Python