-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kiri button in pcb editor fails to launch kiri #121
Comments
Can you double check if you have the right PATH set? Alternatively, if you need a workaround, you could edit this file: /home/username/.local/share/kicad/8.0/scripting/plugins/kiri/KiRI.py Updating cmd = ['/path/to/kiri/bin/kiri', project_file_path, "-u", "-t", "2", "-r"]
except:
cmd = ['/path/to/kiri/bin/kiri', "-u", "-t", "2", "-r"] |
I improved Kiri and the Kiri plugin regarding this issue, but I still think Kiri is not in the PATH. Can you share the result of these commands (running them on a terminal)? echo $HOME
which kiri Also it looks like your path is a bit off but I am not sure if this is the issue. You have a path starting with |
I anonymized my username before posting, old habit. I re-installed Kiri by re-running the command bash -c "INSTALL_KIRI_REMOTELLY=1; \
$(curl -fsSL https://raw.githubusercontent.com/leoheck/kiri/main/install_kiri.sh)" but there was no change. Trying to press the button to run the plugin still gives the same exception as in my initial post. I tried re-running the script to install the plugin, by running the command bash -c "INSTALL_KIRI_REMOTELLY=1; \
$(curl -fsSL https://raw.githubusercontent.com/leoheck/kiri/main/install_plugin.sh)" and got the following output: Traceback (most recent call last):
File "/home/jpotts/.local/share/kiri/bin/kicad_version.py", line 23, in <module>
import pcbnew as pn
ModuleNotFoundError: No module named 'pcbnew'
Kiri plugin installed in /home/jpotts/.local/share/kicad//scripting/plugins/kiri This is a bit odd, since pcbnew exists. Here's the result of the commands you asked for: jpotts@ENG-44-LX:~$ echo $HOME
/home/jpotts
jpotts@ENG-44-LX:~$ which kiri
/home/jpotts/.local/share/kiri/bin/kiri I'm able to run kiri directly, with the following command/output: kiri ~/Documents/kicad_repos/3080/3080.kicad_pro
Artifacts Summary
5 commits (10 comparisons)
Generating artifacts (may take some time)
Assembling the HTML
- Adding list of commits
- Adding list of pages
- Adding list of layers
Latest rev f5c3b4b
- Project's title (folder name): 3080
- Project's name (file name): 3080
- Sch title: 3080
- PCB title: 3080
- Sch revision: 00
- PCB revision: 00
- Sch date: 2024-11-05
- PCB date: 2024-11-05
Kiri main page
- Initial project path:
Pro 1: .kiri/f5c3b4b/3080.kicad_pro
Pro 2: .kiri/3be8ebf/3080.kicad_pro
Traceback (most recent call last):
File "/home/jpotts/.local/share/kiri/bin/kicad_version.py", line 23, in <module>
import pcbnew as pn
ModuleNotFoundError: No module named 'pcbnew'
Starting webserver at http://127.0.0.1:8080/web/index.html
(Hit Ctrl+C to exit) Again there's the strange ModuleNotFoundError exception (I don't recall if that was popping up when I ran it before or not), but the program runs fine. I did some further searching on that error, apparently it's an been an issue but should be fixed. I added the following to .bashrc as a workaround: export PYTHONPATH=/usr/lib/python3/dist-packages/ and then re-ran the plugin install script: jpotts@ENG-44-LX:~$ bash -c "INSTALL_KIRI_REMOTELLY=1; \
$(curl -fsSL https://raw.githubusercontent.com/leoheck/kiri/main/install_plugin.sh)"
Kiri plugin installed in /home/jpotts/.local/share/kicad/8.0/scripting/plugins/kiri (seems to be a different path than it was installing to previously) Now when I click the action plugin button in the pcb editor, nothing happens. No exception is raised, but kiri also does not run. |
For good measure, I tried replacing "kiri" with the path to kiri in the plugin script located at ~/.local/share/kicad/8.0/scripting/plugins/kiri. After your changes, it looks like that's done with the kiri_bin variable on line 64, which I changed from
to
however, this didn't make any difference. |
Did you install Kiri dependencies? This is a missing dependency. ModuleNotFoundError: No module named 'pcbnew |
This script here
|
Yes, I installed the dependencies before installing kiri. To doublecheck, I re-ran that script just now, no change. I also re-ran the install script after, still no change. As I mentioned, pcbnew not being found is a something of a known issue. Based on the discussion at the link I posted, it's related to sysconfig being used instead of distutils in python 3.12, and pcbnew not being exactly where sysconfig expects it to be. To address this, I ran |
Instead of launching kicad and opening the pcb from there, I ran pcbnew from command line to get the output. When I click the kiri button, the command line prints out the following:
However, the webpage doesn't seem to launch. It doesn't just not open, if I navigate to http://127.0.0.1:8080/web/index.html, I get "The site cannot be reached". As mentioned previously, I can run kiri directly from the command line with |
wait a bit more... |
Now I am calling kiri-server directly, it may take less time to launch. Hope it works. |
It looks like you are almost there. Launch kicad from the command line, this way:
Then go to your board layout. |
I am closing this issue since it looks like it is solved. But if the problem still persists, please feel free to continue the conversation here. |
I ran the script to update, ran kicad with
However, nothing happened. I opened a new command line, entered
ie kiri-server is dying silently and sitting there as a zombie process. |
I uncommented lines 114-116, which told me that it was failing to find index.html before crashing. Some different error handling may be warranted there, but I've managed to fix my issue in the short term by replacing line 108 with the following two lines:
This assumes that the files will always be in a folder ".kiri" in the top level of the project directory, but I don't see this being dynamically set anywhere so it should be fine. |
Actually, my fix only works if I've run kicad from the command line. If I start kicad normally, I still have nothing happen when I click the kiri action plugin button in the pcb editor. |
hm.. ok, so when launching kicad from GUI it does not go to the path of kicad project. and you are also not running it from the project folder on the command line. Then this makes sense. I have to check how to improve kiri plugin then.. also, kiri output should be given to the GUI so the user wont be lost during the process. Thanks for the feedback. |
I've successfully installed kiri and can run it from the command line (kiri path/to/project.kicad_pro), but when I try to launch it from the plugin button in the pcb editor it fails with the following exception:
Other info:
OS: Ubuntu 24.04.1
KiCad: 8.0.6
Kiri: commit 18199e1
The text was updated successfully, but these errors were encountered: