# 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:** 12

<div class="post-metadata">

**Author:** ![ualter](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ualter/32/14099_2.png) [@ualter](https://discuss.python.org/u/ualter)\
**Post date:** [August 9, 2023, 8:50am UTC](https://discuss.python.org/t/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-filesystem-encoding/3173/12 "2023-08-09T08:50:10Z")

</div>

Hi,

It is an old topic, but just in case still helps someone that figured out yet…  
If your context is the same as @ [jiapei100](https://discuss.python.org/u/jiapei100) and mine, which is building your “own” python from cpython source code repository (forked). In my case for my C programs to run, I have setup this configuration:

```auto
export PYTHONHOME=/<path-to-your-local-repo>/cpython
export PYTHONPATH=/<path-to-your-local-repo>/cpython/Lib

```

---

_[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)._
