Open wofy-92 opened 1 year ago
did you fix this?
Hi @devbisme if this problem is not taken, could I solve this ?
I'm not seeing this error when running the tests on linux. You can try it on Windows and see if the error occurs there. If so, then go ahead and attempt a fix. Please use the version1
branch to make your fix. I added a test for generate_pcb()
to test_generate.py
, so make sure to fetch your branch to get that change.
If you don't see any errors, then I can close this issue.
Hi Dave, the problem was majorly for Windows user. We have to include the pcbnew module in our Python library search path in the code of kinet2pcb.py.
I am writing instructions on how one could change the same for beginners using the code for the first time -
sys.path.append('/usr/lib/python3/dist-packages')
, here we have to change this path so that it could locate pcbnew.py file.sys.path.append("C:\\Program Files\\KiCad\\8.0\\bin\\Lib\\site-packages")
ImportError: DLL load failed while importing _pcbnew: The specified module could not be found.
sys.path.append("C:\\Program Files\\KiCad\\8.0\\bin\\")
at line 14. And then our program would work perfectly.Here is how code looked before -
from past.builtins import basestring
import argparse
import logging
import os
import os.path
import re
import shutil
import sys
import kinparse
sys.path.append('/usr/lib/python3/dist-packages')
import pcbnew
import hierplace
For Windows user they have to change as -
from past.builtins import basestring
import argparse
import logging
import os
import os.path
import re
import shutil
import sys
import platform
import kinparse
sys.path.append("C:\\Program Files\\KiCad\\8.0\\bin\\")
sys.path.append("C:\\Program Files\\KiCad\\8.0\\bin\\Lib\\site-packages")
import pcbnew
import hierplace
Thanks for looking at this, @roboPanda69. It appears that the changes need to be made to the kinet2pcb
utility, so I'll do that over there. Then I'll come back and close this issue.
Describe the bug Hi devbisme, When I running the function generate_pcb(), I get a WARNING:
WARNING: kinet2pcb module is missing. Can't generate a KiCad PCB without it.
but I have installed kinet2pcbThe test code in the JupyterLab
output message
WARNING: kinet2pcb module is missing. Can't generate a KiCad PCB without it. @ [D:\Python310\Lib\site-packages\IPython\core\interactiveshell.py:3433=>C:\Users\Administrator\AppData\Local\Temp\ipykernel_29400\1868553726.py:4] INFO: 1 warnings found while creating PCB. INFO: 0 errors found while creating PCB.
Screenshots
Desktop (please complete the following information):