Yes it works with nightlies. Your version of kicad doesnt seem to have python scripting enabled. Where did you get it from?
Edit: actually no, recent nightlies dont add python flag in version info anymore because it’s on by default. you must have extracted it with an extra folder or extracted it partially.
The slashes are (mostly) backward in the latter. Is that a typo created in the process of detailing this problem in the forum, or are those last two directories really using the wrong slashes?
Good catch, rco3. I will check tomorrow, as my computer is at my desk at work. I have tried so many different things, so I’ve lost track of it all. That’s why I tried to clean all traces of Kicad and do a fresh install. But I know to have at some point made the directories manually. I can’t rule out to have f’d up the slashes. But only for the last part of the paths, \scripting\plugins
C:/Users and
C:\Users is certainly not done by me manually.
Could there be some “lost in translation” going on here? Windows tends to translate some words to the local language. Maybe it changes the direction of the slash too?
Thanks for your kind help so far. I’ve used this plugin a lot earlier, mostly on the nightlies. It’s very helpful for prototyping etc.
Ignore the slashes, on windows both forward slash and backslash are interchangeable. C:\Users\myname\Documents\KiCad\5.99\scripting\plugins
This path is correct and that’s where you should put the plugin. Make sure that when you extract it you extract everything but without additional intermediate folders. I.e. immediately in plugins folder there should be InteractiveHtmlBom subdirectory and within that the files and folders of plugin, including __init__.py file.
If you did all that but still don’t see the plugin then run this in scripting console:
That last line, print(pcbnew.FULL_BACK_TRACE), got me on track to find the error. It throws an error message and then stops:
" File “C:\Program Files\KiCad\5.99\bin\lib\locale.py”, line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting"
I then checked Preferences -> Set language. I had it on “Default”
Changed it to English, restarted Kicad, and voila! The icon is now there, and everything works as intended.
Thanks for your help!
@BlackCoffee this is not an eeschema bom plugin, please read about it before offering wrong advice.
@PaulaM ignore the slashes, forward and back slash are interchangeable as path separators on Windows.
The issue is this:
File "C:\Users\Paula\AppData\Roaming\kicad\scripting\plugins/InteractiveHtmlBom/__init__.py", line 47, in <module>
from .ecad.kicad import InteractiveHtmlBomPlugin
ImportError: No module named kicad
It seems you are missing InteractiveHtmlBom/ecad/kicad.py file. Can you check if it’s there? Did you extract the folder with all subfolders and files?
I read your initial post - you say Nothing about eeschema, pcbnew or have info to suggest your intened use.
And, there are zillion posts - who would read them all!!!
I won’t try your plugin but, on my system (OSX) I cannot mix slashes without Python problems…
Yes, that file is there.
And yes I extracted the file and all it’s contents, then copied the InteractiveHtmlBom folder, and it’s contents to the directory.
import pcbnew
print(pcbnew.FULL_BACK_TRACE)
Traceback (most recent call last):
File "C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py", line 2954, in LoadPluginModule
mod = __import__( ModuleName, locals(), globals() )
File "C:\Users\Paula Maddox\AppData\Roaming\kicad\scripting\plugins/InteractiveHtmlBom/__init__.py", line 47, in <module>
from .ecad.kicad import InteractiveHtmlBomPlugin
File "C:\Users\Paula Maddox\AppData\Roaming\kicad\scripting\plugins/InteractiveHtmlBom/ecad/kicad.py", line 9, in <module>
from ..core import ibom
File "C:\Users\Paula Maddox\AppData\Roaming\kicad\scripting\plugins/InteractiveHtmlBom/core/ibom.py", line 10, in <module>
from typing import Optional
ImportError: No module named typing
This makes more sense. I pushed a fix to github. You can either get fresh version (make sure to completely delete old one, extract new, restart kicad) or you can run this in cmd:
WOHOOO!!!
thank you so much, it’s up and running!
(i’m showing my boss KiCAD to get him to switch away from fusion360 and your HTML plugin is one of the best features for KiCAD).
FYI-Clarification - The reason you can now mix the slashes (screenshot below). For older codes ver’s<3.4, can’t mix them without problems (should say, “I can’t mix them on my machine”). And, yes, I still use some older Python codes for Kicad Plugin’s. Specifically, codes to run external Java codes with declared paths to the files… But, I get your point…
Support of slashes has nothing to do with python itself, it’s about os filesystem. Windows treats both ‘/’ and ‘\’ as path separators (at least since win NT). *nix based systems require ‘/’.
My plugin code doesn’t care about slashes and uses os.path functions and relative imports for compatibility across all platforms and py2 and py3. The reason you see mix of slashes in stack trace is because of nuances of how kicad imports modules but it’s harmless.