Comment 3 for bug 1853496

Revision history for this message
nico (zeroisnan) wrote :

Providing personal experience with this issue using a fresh install
Version information at the bottom of the message

I believe the title of this issue is misleading
You can simply reproduce the error by invoking the interpreter from the command line:
/c/Program\ Files/KiCad/bin/python

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00003db8 (most recent call first):

Setting PYTHONHOME and PYTHONPATH does not resolve the issue
KICAD_HOME="/c/Program\ Files/KiCad"
export PYTHONHOME="$KICAD_HOME/lib/python2.7"
export PYTHONPATH="$PYTHONHOME:$PYTHONHOME/lib-dynload:$PYTHONHOME/site-packages"

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00003174 (most recent call first):

Note the python version reported:
/c/Program\ Files/KiCad/bin/python --version
3.7.5

Is this expected? The site-package within KiCAD installation refers to python 2.7 instead

This issue does not only affect EEschema, it prevents any standalone usage of the pcbnew python module.

Application: Pcbnew
Version: (5.1.5)-2, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.71.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.66.0
    Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Thanks,
nico