Python environment in Fedora 40 (make use of RF-tools-KiCAD)

I am using

Application: KiCad x86_64 on x86_64
Version: 8.0.6, release build
Libraries:
    wxWidgets 3.2.6
    FreeType 2.13.3
    HarfBuzz 9.0.0
    FontConfig 2.15.0
    libcurl/8.10.1 OpenSSL/3.3.2 zlib/1.3.1 libidn2/2.3.7 libpsl/0.21.5 nghttp2/1.64.0
Platform: Freedesktop SDK 24.08 (Flatpak runtime), 64 bit, Little endian, wxGTK, X11, gnome, wayland
OpenGL: Intel, Mesa Intel(R) UHD Graphics (TGL GT1), 4.6 (Compatibility Profile) Mesa 24.2.6 (git-c6b3580271)
Build Info:
    Date: Oct 14 2024 22:25:13
    wxWidgets: 3.2.6 (wchar_t,wx containers) GTK+ 3.24
    Boost: 1.86.0
    OCC: 7.8.1
    Curl: 8.10.1
    ngspice: 43
    Compiler: GCC 14.2.0 with C++ ABI 1019
Build settings:

in Fedora 40. I want to make use of RF-tools-KiCAD. I cloned the repo into /home/myself/.var/app/org.kicad.KiCad/data/kicad/8.0/scripting/plugins and the new functionality is showing up in the PCB editor. When I click on the “via fence generator” I get the error

✘ ERROR Missing KiCAD 'pyclipper' python module:
please install it using pip
in your KiCAD python environment.
[You may need administrative rights]

Googling, I find that on Linux systems KiCad uses the system environment. I installed the package with pip install pyclipper, and it was installed:

$ pip list | grep pyclipper
pyclipper          1.3.0.post6

However, KiCad’s python is still unable to find it.

How can I solve this?

It is working for me on Fedora 41 with KiCad 8.0.6-1.fc41.

I cloned the RF tools into ~/.local/share/kicad/8.0/scripting/plugins.

I initially saw the same error that you saw. Then I installed pyclipper:

$ pip install pyclipper
Defaulting to user installation because normal site-packages is not writeable
Collecting pyclipper
  Downloading pyclipper-1.3.0.post6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.0 kB)
Downloading pyclipper-1.3.0.post6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (962 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 962.5/962.5 kB 6.5 MB/s eta 0:00:00
Installing collected packages: pyclipper
Successfully installed pyclipper-1.3.0.post6

At that point the error went away and I was able to run the round_tracks tool.

Is the “Via fence generator” working for you?

image

Yes - I just tried it, and attached a screenshot. What happens when you try it?

Thanks for confirming. If I click on that button I get an error message in a popup window:

✘ ERROR Missing KiCAD 'pyclipper' python module:
please install it using pip
in your KiCAD python environment.
[You may need administrative rights]

If I open the “KiPython” console:

Py 0.9.8
Python 3.12.7 (main, Nov 10 2011, 15:00:00) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Startup script executed: /home/msenger/.var/app/org.kicad.KiCad/config/kicad/8.0/PyShell_pcbnew_startup.py
>>> 
>>> import pyclipper
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'pyclipper'

which is expected, I guess. However, in the global system environment, I have it installed:

$ pip list | grep pyclipper
pyclipper          1.3.0.post6
$ ipython
Python 3.12.7 (main, Oct  1 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.23.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pyclipper

In [2]: 'It worked'
Out[2]: 'It worked'

Flatpak apps have no visibility of packages you install in your system, they are sandboxed. If installing kicad as a native app (not flatpak) is not an option then you can try to get a shell within kicad’s flatpak sandbox and installing pip package from within. If memory does not fail me it’s something like flatpak run <application id> --command /bin/bash to get the shell.

2 Likes

Thanks, that was it. For the record, the command that worked for me (Fedora 40):

  1. Open a terminal and run: flatpak run --command=sh org.kicad.KiCad
  2. You should now be inside this environment: [📦 org.kicad.KiCad ~]$
  3. Now run pip install whatever_you_want
  4. exit

@SengerM @SteveFalco
I have just updated RF-tools w/ small fixings and I have added a pcm package…
Could you please check if this new release and package is correctly installing on your side?

RF-tools-KiCAD-v1.3.2_pcm.zip

@maui seems to work. I removed my old installation, downloaded the pcm, installed it with KiCad’s package manager, and was able to generate a via fence.

1 Like

@SengerM
thanks, I’m going to prepare a PR to include RF-tools in the kicad plugins repo