[Python] Can't run Python 3, io.py gives a AttributeError on Windows 10

Discussão em 'Python' iniciado por Stack, Junho 6, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to run Python3 on my Windows but it gives me a AttributeError from io.py.

    I have tried both the Windows Store version and Download from https://www.python.org/downloads/

    When I try to run python3 or py in PowerShell 7.2.6 terminal I get

    PS>python3
    >Fatal Python error: init_sys_streams: can't initialize sys standard streams
    Python runtime state: core initialized
    Traceback (most recent call last):
    File "C:\Program\Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\io.py", line 87, in <module>
    AttributeError: module 'abc' has no attribute 'ABCMeta'


    or

    PS>py
    >Fatal Python error: init_sys_streams: can't initialize sys standard streams
    Python runtime state: core initialized
    Traceback (most recent call last):
    File "C:\Users\UserName\AppData\Local\Programs\Python\Python310\lib\io.py", line 87, in <module>
    AttributeError: module 'abc' has no attribute 'ABCMeta'


    With troubleshooting I have tried a few things

    1. To reinstall both from the Windows Store and the Download from https://www.python.org/downloads/, but it doesn't seem to resolve the problem.
    2. Only run the store version or the download from the website.
    3. I have tried to troubleshoot on the internet, but I don't see anything when it comes to running Python alone. And usually comes down to naming Python scripts which I don't want to run specificly.
    4. I thought it could be a systen PATH problem in Windows, but that seems to be not the case as it still didnt work after I changed the path to "C:\Users\UserName\AppData\Local\Programs\Python\Python310" and "C:\Users\UserName\AppData\Local\Programs\Python\Python310\Scripts".

    And the problem seems to come from the io.py which can't see the attribute ABCMeta from the module abc.

    How can I solve this problem?

    Continue reading...

Compartilhe esta Página