python path in eeschema

Bug #1820781 reported by Adam Wolf
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

Basically, the BOM Generator dialog is running python but it's running the system python (with the bundled python's libraries :D). We want it to runthe bundled python. When users modify the command to use the bundled python, it works fine.

So I dug into it, and we fix the PATH so that when something from pcbnew runs "python", it runs the right python on both macOS and Windows.

https://github.com/KiCad/kicad-source-mirror/blob/27d57d9191d0807722f2cd2b6b61cdb67e247612/pcbnew/pcbnew.cpp#L260

I was going to fix it in common.cpp but I have not been able to get to it in the last few months so I am opening this up to anyone.

Adam Wolf (adamwolf)
tags: added: macos
tags: added: python
Changed in kicad:
importance: Undecided → Low
milestone: none → 6.0.0-rc1
status: New → Triaged
tags: added: eeschema
Revision history for this message
Nicholas Savenlid (nicholas-z) wrote :

i think something snapped here recently

BOM generator stopped working.

Run command:
python "C:\Program Files\KiCad\bin\scripting\plugins/bom_csv_grouped_by_value.py" "C:\Cad\AC\Batteries\STB4\5SnP_4211573380\4211573380_R15_2019_11_15_BMZ_ECN\Display.xml" "C:/Cad/AC/Batteries/STB4/5SnP_4211573380/4211573380_R15_2019_11_15_BMZ_ECN/Display.csv"

Command error. Return code 3
Error messages:
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 0x00007b10 (most recent call first):

Application: Eeschema
Version: (5.99.0-393-gd4cea0f2b), 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:
    Build date: Nov 18 2019 19:40:04
    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:
    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

tags: added: packaging
Revision history for this message
Nick Østergaard (nickoe) wrote :

I confirm that this is a packaging issue.

I think it is because the python.exe is now python3 in msys2.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Does this affect the most recent 5.1.5 package?

Revision history for this message
Nick Østergaard (nickoe) wrote :

It affects 5.1.5_1 and 5.1.5_2.

Revision history for this message
Adam Wolf (adamwolf) wrote : Re: [Bug 1820781] Re: python path in eeschema

The original bug here is not a packaging issue, but rather that we
missed fixing the Python executable search path in eeschema the same
way we do in pcbnew, but that's different than the windows python.exe
vs python3.exe, buuut if someone fixes that via a patch, maybe we
could fix both at the same time.

On Wed, Dec 4, 2019 at 10:21 AM Nick Østergaard
<email address hidden> wrote:
>
> It affects 5.1.5_1 and 5.1.5_2.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1820781
>
> Title:
> python path in eeschema
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1820781/+subscriptions

Revision history for this message
Nick Østergaard (nickoe) wrote :

Hmm, I am not sure what the original report is about, but I am talking about the issue in #1 and that is a windows packing issue. It will be fixed in the 5.1.5_3 windows build.

Changed in kicad:
assignee: nobody → Nick Østergaard (nickoe)
milestone: 6.0.0-rc1 → 5.1.6
milestone: 5.1.6 → 6.0.0-rc1
assignee: Nick Østergaard (nickoe) → nobody
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Nick, what happened with the milestone and assignee? Did you discover that the bug was not a windows package build issue?

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Wayne, I have no idea what the original bug description is about. But it seems to be something different, what I fixed is what Nicholas reported in #1, and there was another bug for that.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

I propose to move the discussion here: https://gitlab.com/kicad/code/kicad/issues/1880

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1880

Changed in kicad:
status: Triaged → Expired
Changed in kicad:
importance: Low → Unknown
status: Expired → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.