I’ve quickly gotten lost in several rabbit holes here. I want to use the kicad_picknplace_assistant.py script from this thread:
I don’t know how to use it on my Win10 system. I appologize that I feel the answer to my question isn’t so much about KiCad, rather the proper Python installation that can access the kicad modules.
I’ve tried running it from the python console in kicad with execfile(“kicad_picknplace_assistant.py”) not expecting it to work because I’m not sure how to pass the file argument. But it failed loading numpy instead. I don’t know how to install numpy (and will also eventually need to install matplotilb) for kicad’s python console.
I installed Anaconda v5.2, but don’t know how to link the pcbnew module to where the python accessed via Anaconda Prompt can find it, so I get the following traceback:
Traceback (most recent call last): File "kicad_picknplace_assistant.py", line 5, in <module> import pcbnew ModuleNotFoundError: No module named 'pcbnew'
I’ve tried putting the kicad_picknplace_assistant.py script into %AppData%\kicad\scripting and %AppData%\kicad\scripting\plugins. A .pyc (is that compiled?) is created in %AppData%\kicad\scripting but I don’t know how to access the script from within PCBNew or the python console. Even if I could, I suspect it would crap out trying to import numpy and how would I provide the board file?
I didn’t see any of the forks of the script appearing to have been modified as an action script, and again the lack of numpy and matplotlib…
Is there a better way of installing Python on Win10 that can access the pcbnew module to run a script from the command line? Was Anaconda a bad choice?
FWIW, I’m currently running the r10603 rc3-dev of KiCad v5 on Win 10 Pro Version 1803 build 17134.137 Here is the version info for KiCad:
Application: kicad Version: (5.0.0-rc3-dev-2-g101b68b61), release build Libraries: wxWidgets 3.0.3 libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3 Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW Build Info: wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) Boost: 1.60.0 OpenCASCADE Community Edition: 6.8.0 Curl: 7.54.1 Compiler: GCC 7.1.0 with C++ ABI 1011 Build settings: USE_WX_GRAPHICS_CONTEXT=OFF USE_WX_OVERLAY=OFF KICAD_SCRIPTING=ON KICAD_SCRIPTING_MODULES=ON KICAD_SCRIPTING_WXPYTHON=ON KICAD_SCRIPTING_ACTION_MENU=ON BUILD_GITHUB_PLUGIN=ON KICAD_USE_OCE=ON KICAD_USE_OCC=OFF KICAD_SPICE=ON