Kicad stable (pcbnew) crash on windows 10 (python problems)

I installed kicad for the latest windows stable version 4.0.4 on windows 10. But upon opening pcbnew , kicad shuts down without any reason or notice.

I have to build my designs urgently. I have seen suggestions to build kicad using source code but I have been unsuccessful in building kicad using source code. Can someone please help me out.

You can also try the nightly builds to see if that works. There are more tools available but also some file format changes so that the output is not quite compatible with the ‘stable’ release.

http://downloads.kicad.org/windows/nightly/

Where did you get your copy of 4.0.4? Do the other parts like eeschema and the kicad main app run?

eeschema is working properly . I tried reinstalling multiple times to check if there were some issues with my install but apparently it shuts down repeatedly. Also, the footprint editor also resulted in the same issue.

I installed the nightly builds that you recommended but I am facing the same issue. Is there something that I have missed in installing ? Any specific repositories or files etc ?
@cbernardo

Do you have an unusual Python installation?

Unusual meaning?
I have both Python 2.7.9 and miniconda installed together.

KiCad makes heavy use of Python. I have seen several threads in the last year of problems triggered by Python developer installations

If i encounter a software that crashes without any error message i use a terminal to start it and hope that some sort of output is printed there.
If it is possible to to something similar in windows you could try that. Maybe KiCad does print some “error” message there. (Not correctly handled exceptions could cause such a behavior.)

See these topics


One more thing that can cause mysterious crashes is if the scenegraph library (libkicad_3dsg.dll) cannot be found. It should be in the same directory as your pcbnew.exe and _pcbnew.kiface. I’d be surprised if that were the problem though since the installer should have put them all in the right place.

@davidsrsb Thanks for the references. I have got it working by changing the PYTHONPATH which I had modified earlier for installing opencv. But I have new problem now - when i launch the pcbnew an error message pops up :

"05:20:33: ***** Error importing the wxPython API! *****
05:20:33: pcbnewInitPythonScripting() failed.
"

Any solution to this ?

It’s annoying. I have tried so many different things.

Check python-wxversion, I have 3.0.2.0+dfsg-1build1

I took the liberty of changing the name of this conversation so that it gives more details.

@davidsrsb i have 3.0.2.0

Also, does it mean that the pcbnew.py file is unable to access wx scripts installed in the same folder?

In the C:\KiCad\lib\python2.7\site-packages folder do you have any .pyc files associated with wx-python installation ? or any scripts created from the wx installation?

I had the same problem but suspect it is the known issue with the Intel video drivers.


Installed on a different system with a different video card and it worked fine.
So if you have the •Intel Graphics Media Accelerator (GMA) 4500M video adapter, that might be the problem.

I removed all references to other Python installs on the system with the bad video driver and it still didn’t do the job.

@Rob_Ryks I have solved the first issue of pcbnew crashing which was due to python references in the environment variables.
I do have a new problem though - which is “unable to import wxpython api”.

Have tried everything. It’s hard to get rid of the problem.

I have moved to eagle for the time.

Did you try a windows install on a VM and then putting KiCAD onto that to see if it’s your main installation?

Also, did you check the version of your python vs wxpython?
I remember having had issues were one was 64bit and the other 32bit and nothing worked…

Oh, and while you’re at it, check your pythonpath for wrong directions… I would try by starting the command line in the kicad-python folder and then do this in the python shell there:

import sys
print(sys.path)

See what it tells you there vs when you start the command line + shell in the root folder.

Look what I just got (after playing around with my pythonpath variable earlier today, essentially I created it and changed the order of things in there):

I didn’t change anything on the KiCAD install.
All I did was trying to get my python 2.7 install to see the pyserial/serial module by installing that.
But it never really stuck with the python shell I got when I typed python at the command line… so I tried it with the environment variable.

OK, now I removed the PYTHONPATH variable again and it’s content from Win7 and restarted KiCAD - no problem anymore.
PCBnew starts without issue and console is available

Now I listed the pythonpath variable that KiCAD ‘ships’ with:

C:\Program Files\KiCad\lib\python27.zip
C:\Program Files\KiCad\lib\python2.7
C:\Program Files\KiCad\lib\python2.7\plat-win32
C:\Program Files\KiCad\lib\python2.7\lib-tk
C:\Program Files\KiCad\lib\python2.7\lib-old
C:\Program Files\KiCad\lib\python2.7\lib-dynload
C:\building\msys32\mingw64
C:\Program Files\KiCad\lib\python2.7\site-packages
C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw
.
C:/Program Files/KiCad/bin/…/share/kicad/scripting
C:/Program Files/KiCad/bin/…/share/kicad/scripting\plugins

And this is the pythonpath content that KiCAD had a problem with (as I forced it):

C:\Python27\lib\site-packages\future-0.15.2-py2.7.egg
C:\Python27\lib\site-packages\beautifulsoup4-4.4.1-py2.7.egg
C:\Python27\lib\site-packages\pcb_tools-0.1-py2.7.egg
C:\Python27\lib\site-packages\kicost-0.1.25-py2.7.egg
C:\Python27\lib\site-packages\tqdm-4.7.4-py2.7.egg
C:\Python27\lib\site-packages\yattag-1.6.0-py2.7.egg
C:\Windows\system32\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages
C:\Panda3D-1.8.0
C:\Panda3D-1.8.0\bin
C:\Python27\lib\site-packages\wx-3.0-msw

So check, that you don’t have a pythonpath defined and maybe that those folders+content exists on your machine for KiCAD.

1 Like