Not able to run third party scripts on macOS

I came across these awesome scripts from Greg Davill for exporting beautiful images of the board layouts, silkscreens etc. I will later import these in Fusion 360 to create a realistic 3D model of the final board. I’m on a Mac running Mojave and this thread helped a little towards running these scripts from the python builtin with KiCad. However, I get the following errors listed below. I’m fairly a newbie when it comes to Python and any help in running these would be appreciated.

dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/_pcbnew.so being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libwx_osx_cocoau_gl-3.0.0.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libwx_osx_cocoau-3.0.0.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libkicad_3dsg.2.0.0.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libGLEW.2.2.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libcairo.2.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libpixman-1.0.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libfontconfig.1.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libfreetype.6.dylib being ignored in restricted program because of @executable_path
dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/../../libpng16.16.dylib being ignored in restricted program because of @executable_path
Fatal Python error: PyThreadState_Get: no current thread
[1]    88414 abort      python plot_board.py

Here is the version info of my KiCad install:

Application: KiCad
Version: (5.1.9-0-10_14), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: macOS Mojave Version 10.14.6 (Build 18G7016), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.75.0
    OpenCASCADE Technology: 7.5.0
    Curl: 7.54.0
    Compiler: Clang 10.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    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=OFF
    KICAD_USE_OCC=ON
    KICAD_SPICE=ON

How exactly are you running the script? Can you post your full command here?

python plot_board.py /path/to/kicad_pcb_file/pcb.kicad_pcb

Are you using python from kicad app and not system python? Have you added sys.path patch as described here Running a KiCad script on MacOS ?

Yes. This is the modified python file. Inkscape path is on line 422.

I don’t know how to help you further, the error seems related to macos codesigning issues. Report this on kicad gitlab if you can.

But if your goal is to get pretty image of the board then you can try importing the board into freecad using KiCad StepUp tool plugin and that will give you actual 3d model of the board with copper and everything, you can then use that model in your rendering software.

Another option is to use https://www.pcbway.com/project/OnlineGerberViewer.html

It allows you to save pretty svg files like this

Thank you for trying. The boards that you can export as STEP from KiCad are sufficient TBH. I just wanted to see how I can make them more realistic.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.