# Fatal Python error: init\_fs\_encoding: failed to get the Python codec of the filesystem encoding

**URL:** <https://discuss.python.org/t/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-filesystem-encoding/3173>\
**Category:** Python Help\
**Created:** [February 11, 2020, 1:29pm UTC](https://discuss.python.org/t/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-filesystem-encoding/3173 "2020-02-11T13:29:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zware](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/zware/32/58_2.png) [@zware](https://discuss.python.org/u/zware)\
**Post date:** [February 11, 2020, 4:26pm UTC](https://discuss.python.org/t/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-filesystem-encoding/3173/2 "2020-02-11T16:26:58Z")

</div>

Hello and welcome 🙂

This is not a Python bug, this is a symptom of setting `PYTHONHOME` and/or `PYTHONPATH` when they’re not needed. In nearly all cases you don’t need to set either of them; in the case of `PYTHONHOME` it’s almost always a mistake to set.

Is there a particular reason you’re trying to set these variables? Are you following a guide that suggests it?

---

_[View the full topic](https://discuss.python.org/t/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-filesystem-encoding/3173)._
