[SOLVED] InteractiveHtmlBom not working, help!

I’m trying InteractiveHtmlBom for the first time and I got this error,
does any one knows if this is any issue with Kicad or with plugin?

Loading [...]Voices.kicad_pcb
Traceback (most recent call last):
  File "InteractiveHtmlBom/InteractiveHtmlBom/generate_interactive_bom.py", line 48, in <module>
    parser = get_parser_by_extension(os.path.abspath(args.file), config, logger)
  File "/home/kammutierspule/.kicad/scripting/plugins/InteractiveHtmlBom/InteractiveHtmlBom/ecad/__init__.py", line 7, in get_parser_by_extension
    return get_kicad_parser(file_name, config, logger)
  File "/home/kammutierspule/.kicad/scripting/plugins/InteractiveHtmlBom/InteractiveHtmlBom/ecad/__init__.py", line 15, in get_kicad_parser
    from .kicad import PcbnewParser
  File "/home/kammutierspule/.kicad/scripting/plugins/InteractiveHtmlBom/InteractiveHtmlBom/ecad/kicad.py", line 4, in <module>
    import pcbnew
  File "/usr/local/lib/python2.7/dist-packages/pcbnew.py", line 38, in <module>
    import _pcbnew
wx._core.wxAssertionError: C++ assertion "classTable->Get(m_className) == NULL" failed at /tmp/pip-build-Rq6oRw/wxPython/ext/wxWidgets/src/common/object.cpp(251) in Register(): Class "wxAuiNotebookXmlHandler" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?

Maybe @qu1ck can answer you right away, but probably you should give detailed info about your system, versions and other setup. You seem to be using some Linux but python2 which is a suspicious combination (KiCad usually uses python3 on Linux, although it depends on the distro).

I’m building it myself, I will look if I can built it with python3 support.

That stack trace shows that plugin was unable to import pcbnew module which means your kicad install is broken.
Yeah, you should compile with python3 on linux.

I’m trying python3, but I got this error while building KiCad:

CheckFindPackageResult.cmake:6: error: Python Interpreter was not found - it is required to build Kicad CMakeLists.txt:742 (check_find_package_result)

What I’m I missing in the system?

Python3, from the looks of it.
It may be a misleading message though, if you do have python3 installed then post your cmake configure command line and full log of the error.

1 Like

Could NOT find PythonInterp: Found unsuitable version “2.7.17”, but required is at least “3.3” (found /usr/bin/python2)

but I have python3 3.6.9 installed, could some component be missing?

It actually looks like a broken wxWidgets install.

@kammutierspule ensure you have built with wxPython/Phoenix enabled (depending on which one you want to use), and it is installed for the interpreter version you are using (e.g. you have the Python 2 version if you use Python 2). It

2 Likes

Yes, in that case you are likely missing wxPhoenix.

1 Like

Sorry I know nothing much of Python world so I should be missing something
I see that I have installed “python3-wxgtk4.0” package
Phoenix I cannot find anything about it how to install it (Linux Mint here, Ubuntu/Debian based)

One more thing to try: after changing config variables to compile with python3 clear the cmake cache (delete everything in build directory to be sure).

1 Like

That is the right package. wxPhoenix is just another name for wxPython 4.

I managed to pass cmake! Thanks! I will build now KiCad and test with Python3.

I am not sure what I did but I selected the option to use Phoenix in cmake and cleaned the cache as you suggest.
I also installed this packages:

freeglut3 freeglut3-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libjavascriptcoregtk-1.0-dev libjavascriptcoregtk-3.0-dev liborc-0.4-dev liborc-0.4-dev-bin libsoup2.4-dev libwebkitgtk-3.0-dev libwebkitgtk-dev libxml2-dev python-gst-1.0 python3-gst-1.0

I will report if I can get it work latter…

That means you need to build with the flags
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON

Building with python2 would give you problems since you had a python3 wx version.

1 Like

It build and installed

Installing: /usr/local/lib/python3/dist-packages/pcbnew.py

but when I run InteractiveHtmlBom I got

ModuleNotFoundError: No module named ‘pcbnew’

I tried to run it inside KiCad and now it is working!
I think it is good for me, thanks all for the help! :slight_smile:

When running ibom from console you need to use python3 as well.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.