Kicad 6 pcbnew scripting console error

Whenever I try to open python scripting console in kicad 6 it gives error.
The error I am getting only in ubuntu, not in windows.
Any idea?

File “/usr/lib/python3/dist-packages/wx/core.py”, line 3185, in CallAfter
assert app is not None, ‘No wx.App created yet’
AssertionError: No wx.App created yet

2 Likes

I am having the same issue. I am using Ubuntu 18.04 and have tried the repo and compiling from source – same error.

Full error in pop up wxPythong stdout/stderr window:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/usr/local/share/kicad/scripting/kicad_pyshell/__init__.py", line 253, in makePcbnewShellWindow
    return KiCadPyShell(parent)
  File "/usr/local/share/kicad/scripting/kicad_pyshell/__init__.py", line 39, in __init__
    KiCadEditorNotebookFrame.__init__(self, parent)
  File "/usr/local/share/kicad/scripting/kicad_pyshell/kicad_pyeditor.py", line 939, in __init__
    KiCadEditorFrame.__init__(self, parent)
  File "/usr/local/share/kicad/scripting/kicad_pyshell/kicad_pyeditor.py", line 732, in __init__
    self._setup()
  File "/usr/local/share/kicad/scripting/kicad_pyshell/__init__.py", line 119, in _setup
    execStartupScript=self.execStartupScript)
  File "/usr/lib/python3/dist-packages/wx/py/crust.py", line 47, in __init__
    *args, **kwds)
  File "/usr/lib/python3/dist-packages/wx/py/shell.py", line 347, in __init__
    wx.CallAfter(self.ScrollToLine, 0)
  File "/usr/lib/python3/dist-packages/wx/core.py", line 3185, in CallAfter
    assert app is not None, 'No wx.App created yet'
AssertionError: No wx.App created yet

Any luck on this one??

I just opened the python console in KiCad V6.0.1 running on Linux Mint and it does seem to start as expected:

I don’t know much what to do with Python, so I can’t help any further.

I think you should open an issue: Issues · KiCad / KiCad Source Code / kicad · GitLab

Try updating your OS python to 3.10 and see if the error appears.

I have the same on Ubuntu LTS 18.04 LTS and Python 3.10, and someone on Manjaro too.

I thought it was a problem with my distro’s package because I saw it uses Python 3.10 but the pcbnew’s python module inside the package was in Python 3.9’s directory, however, I removed it and compiled my own KiCad and the problem still persisted for me, so I opened a bug report:

I have the same isuue, too. on Ubuntu 18.04.6.
Is is issue solved?

I tested on ubuntu 20.04 and it works well.

18.04
python3 3.6.9
python3-wxgtk4.0 4.0.1+dfsg-2

20.04
python3 3.8.2-0ubuntu2
python3-wxgtk4.0 4.0.7+dfsg-2build1

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