Skip to content Skip to sidebar Skip to footer

Fatal Python Error: Py_initialize: Can't Initialize Sys Standard Streams

I have a pyproject.toml file that was created using poetry, and I'm trying to run the command poetry install in this directory to create a poetry.lock file. However, when I run po

Solution 1:

Ended up resolving my own issue. For some reason my virtual environment created by poetry is copying/downloading a broken version of Python, which as I said in my initial question, it seemed the python.exe alone was what is throwing the fatal error.

With that, I resolved my issue by:

  1. Downloading a new, non-broken version of Python (the same version that I defined in my pyproject.toml file to use): https://www.python.org/downloads/release/python-385/
  2. Navigated to the virtual env folder poetry told me the error was coming from: C:\Users\myName\AppData\Local\pypoetry\Cache\virtualenvs\my-app-name-kS94etse-py3.8\Scripts\python.exe
  3. Replaced the python.exe currently in that folder with the new one I just downloaded

I'm sure long-run I'll need to find why this is occurring, but this is a quick fix for anyone else running into this issue. Happy poetry-ing!

Post a Comment for "Fatal Python Error: Py_initialize: Can't Initialize Sys Standard Streams"