[Python] Can't run Python script with ./script.py, but works with python script.py — ICU data...

Discussão em 'Python' iniciado por Stack, Julho 11, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using VS Code on Windows 10 and have a fresh installation of the latest Python version (downloaded from python.org). I completely removed any older Python installations before reinstalling.

    When I try to run a Python script using the terminal like this: ./test.py I get this error: [0711/233305.303:ERROR:icu_util.cc(223)] Invalid file descriptor to ICU data received.

    However, if I run it using: python ./test.py

    It works perfectly.

    I’ve made sure:


    • The script has the correct shebang line at the top: #!/usr/bin/env python


    • Python is properly added to my PATH


    • I'm using the integrated terminal in VS Code

    Why does this happen and how can I fix or avoid this ICU-related error when using ./test.py?

    Environment:


    • Windows 10


    • VS Code


    • Python 3.13.5

    Continue reading...

Compartilhe esta Página