Cannot close windows on macOS Sierra 10.12.6

Bug #1729259 reported by Brendan Simon
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
New
Undecided
Unassigned

Bug Description

Cannot close windows on macOS Sierra 10.12.6, when clicking on close button in window frame (red circle/cross in top/left of frame).

The window does not react at all. Minimise (amber) and Full Screen (green) buttons work ok.

It was originally noticed with `pcbnew` and `footprint editor` but also happens with the About dialog box. Interestingly `kicad.app`, `eeschema.app`, `gerbview.app` all work ok.

The close button works fine in other applications, so it must be a Kicad issue.

I can close most windows via the OK or CANCEL buttons, if they have them, but some windows such as `pcbnew` and `footprint editor` do not have these buttons.

Oh, an there doesn't seem to be any menu entries to close the window either.

----

Application: pcbnew
Version: (2017-10-23 revision a562525)-master, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.54.0 SecureTransport zlib/1.2.8
Platform: Mac OS X (Darwin 16.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.61.0
    Curl: 7.43.0
    Compiler: Clang 7.3.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Tags: osx
tags: added: osx
Revision history for this message
Nick Østergaard (nickoe) wrote :

Do you have wxpython installed thorugh homebrew?

Revision history for this message
Brendan Simon (brendan-simon) wrote :

Not through homebrew (as far as I can tell).

I do have wxPython installed via the installation packages, for python 2.6, 2.7, 3.4, 3.5, 3.6.

Why would that make a difference? Isn't Kicad a standalone executable (compiled with C++)?

Revision history for this message
xzcvczx (xzcvczx) wrote :

while it is a standalone thing kicad has a findwxpython thing which searches for system installs over the bundled install of wxpython and that leads to issues

Revision history for this message
Brendan Simon (brendan-simon) wrote :

Is there a way to find out where KiCad thinks it is getting wxpython from?

i.e. what the result of `findwxpython` is?

Revision history for this message
xzcvczx (xzcvczx) wrote :

well if the console works which it likely doesn't you can look at the sys.path array and it will have brew wxpython ahead of bundled wxpython

Revision history for this message
Brendan Simon (brendan-simon) wrote :

I've tried eliminating brew and all other python paths from my system to see if it makes any difference, and can't get the behaviour to change.

I tried renaming `/usr/local/Cellar` to `/usr/local/Cellar.ORIG`

I tried renaming `/Library/Frameworks/Python.framework` to `/Library/Frameworks/Python.framework.ORIG`

I tried removing `/usr/local/bin` from my path.

What else can I try to help resolve this issue? It might not be a wxPython thing? Maybe a Sierra issue?

Is KiCad known to work ok on macOS Sierra?

Revision history for this message
xzcvczx (xzcvczx) wrote : Re: [Bug 1729259] Cannot close windows on macOS Sierra 10.12.6

can you open the python console in pcbnew?

if so can you

import sys
print sys.path

and paste the output of that

and yes kicad works fine on sierra, i am using sierra currently

> On 20/11/2017, at 00:41, Brendan Simon <email address hidden> wrote:
>
> I've tried eliminating brew and all other python paths from my system to
> see if it makes any difference, and can't get the behaviour to change.
>
> I tried renaming `/usr/local/Cellar` to `/usr/local/Cellar.ORIG`
>
> I tried renaming `/Library/Frameworks/Python.framework` to
> `/Library/Frameworks/Python.framework.ORIG`
>
> I tried removing `/usr/local/bin` from my path.
>
> What else can I try to help resolve this issue? It might not be a
> wxPython thing? Maybe a Sierra issue?
>
> Is KiCad known to work ok on macOS Sierra?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729259
>
> Title:
> Cannot close windows on macOS Sierra 10.12.6
>
> Status in KiCad:
> New
>
> Bug description:
> Cannot close windows on macOS Sierra 10.12.6, when clicking on close
> button in window frame (red circle/cross in top/left of frame).
>
> The window does not react at all. Minimise (amber) and Full Screen
> (green) buttons work ok.
>
> It was originally noticed with `pcbnew` and `footprint editor` but
> also happens with the About dialog box. Interestingly `kicad.app`,
> `eeschema.app`, `gerbview.app` all work ok.
>
> The close button works fine in other applications, so it must be a
> Kicad issue.
>
> I can close most windows via the OK or CANCEL buttons, if they have
> them, but some windows such as `pcbnew` and `footprint editor` do not
> have these buttons.
>
> Oh, an there doesn't seem to be any menu entries to close the window
> either.
>
> ----
>
> Application: pcbnew
> Version: (2017-10-23 revision a562525)-master, release build
> Libraries:
> wxWidgets 3.0.2
> libcurl/7.54.0 SecureTransport zlib/1.2.8
> Platform: Mac OS X (Darwin 16.7.0 x86_64), 64 bit, Little endian, wxMac
> Build Info:
> wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
> Boost: 1.61.0
> Curl: 7.43.0
> Compiler: Clang 7.3.0 with C++ ABI 1002
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=ON
> USE_WX_OVERLAY=ON
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1729259/+subscriptions

Revision history for this message
Brendan Simon (brendan-simon) wrote :

With 4.0.7 I just get a white window (no python console).

With a recent snapshot (Version: (2017-11-18 revision 4c623da)-master I get an error dialog that says:

    Message

    Error: Unable to open the Python Console

I have seen the console work in recent days. Probably when I was fooling around with paths. I'll see if I can replicate that and post the `sys.path` output.

Revision history for this message
Brendan Simon (brendan-simon) wrote :

I do NOT have `wxpython` or `wxmac` installed via brew. I do have official wxPython packages installed via the installer for Python 2.5, 2.6 and 2.7. I also have wxPhoenix (wxPython 4.0) wheel installed for Python 3.6 via pip.

I can not close `pcbnew` or open the python scripting console.

If if I rename `/usr/local/bin` and `/usr/local/lib`, then things start to work. i.e. I can close the `pcbnew` window and the python scripting console appears.

    sudo mv /usr/local/bin /usr/local/bin.ORIG
    sudo mv /usr/local/lib /usr/local/lib.ORIG

Interestingly, v4.0.7 python console has some issues with some keys. e.g. I can't press the `o` or `x` keys as they are interpreted as accelerators and the menu flashes. This does not happen in recent snapshots.

import sys
print sys.path
['/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/SharedSupport/scripting', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/brendan/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/usr/local/lib/wxPython-3.0.2.0/lib/python2.7', '.', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/SharedSupport/scripting', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/SharedSupport/scripting/plugins']

Revision history for this message
xzcvczx (xzcvczx) wrote : Re: [Bug 1729259] Re: Cannot close windows on macOS Sierra 10.12.6
Download full text (5.3 KiB)

Ah yes that will be the problem then,

There is current efforts being made to work around this issue, but its not something that will be working soon
Unfortunately the workarounds prior to that are not pretty, and mostly consist of not having a system wxpython install

It will mainly require removing the usage of wxversion.py as that does not work nor is it designed to work with bundled libraries as yeah it breaks stuff (well documented as such) so wxversion.py is only useful on linux.

There is also efforts going on to bundle the entire python runtime as recommended by apple for applications that require python, so this should also help.

> On 21/11/2017, at 12:59 AM, Brendan Simon <email address hidden> wrote:
>
> I do NOT have `wxpython` or `wxmac` installed via brew. I do have
> official wxPython packages installed via the installer for Python 2.5,
> 2.6 and 2.7. I also have wxPhoenix (wxPython 4.0) wheel installed for
> Python 3.6 via pip.
>
> I can not close `pcbnew` or open the python scripting console.
>
> If if I rename `/usr/local/bin` and `/usr/local/lib`, then things start
> to work. i.e. I can close the `pcbnew` window and the python scripting
> console appears.
>
> sudo mv /usr/local/bin /usr/local/bin.ORIG
> sudo mv /usr/local/lib /usr/local/lib.ORIG
>
> Interestingly, v4.0.7 python console has some issues with some keys.
> e.g. I can't press the `o` or `x` keys as they are interpreted as
> accelerators and the menu flashes. This does not happen in recent
> snapshots.
>
> import sys
> print sys.path
> ['/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/SharedSupport/scripting', '/private/var/folders/1h/df5214x933ndx_mpl0h71l_r0000gn/T/AppTranslocation/89F1319C-EF15-4533-943D-13121F48F49B/d/kicad.app/Contents/Frameworks/python/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/brendan/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versio...

Read more...

Revision history for this message
Brendan Simon (brendan-simon) wrote :

Does Kicad actually use wxPython or just python?

If just python, then it should be easy to bundle it up. I use `pyinstaller` to bundle python/wxPython apps with good success (Python-3.6 & wxPy-4.0, Py-2.7 & wxPy-3.0.2, Windows/Mac/Linux).

If wxPython is actually used, then I think the move to wxPy 4 (aka wxPhoenix) will be of great assistance. Robin dropped the `hack.pth` stuff and lot of other legacy hacks, it can be installed standalone, etc.

Revision history for this message
Brendan Simon (brendan-simon) wrote :

My workaround/solution is to put a script to set the path and start the application.

    $ cat ~/bin/kicad.sh

    #!/bin/sh

    export PATH=/usr/bin:/bin:/usr/sbin:/sbin

    open /Applications/Kicad-v4.0.7/kicad.app

It works great.

Could you not have similar scripts in the Application bundle root (for each of the apps/symlinks) so that the paths is set to something minimal for the apps to work?

Not sure if you need to use `open` or not, and make the app path relative to the script location.

That should solve the issue and not have to uninstall python/wxpython installs via brew or what not.

Revision history for this message
Adam Wolf (adamwolf) wrote :

It uses both. There is code in development/testing that bundles
Python in, and may fix this. It should be ready before V5 is
released. Any move to wxPhoenix won't be happening before V5 is
released.

Adam

On Mon, Nov 20, 2017 at 4:38 PM, Brendan Simon
<email address hidden> wrote:
> *** This bug is a duplicate of bug 1490762 ***
> https://bugs.launchpad.net/bugs/1490762
>
> Does Kicad actually use wxPython or just python?
>
> If just python, then it should be easy to bundle it up. I use
> `pyinstaller` to bundle python/wxPython apps with good success
> (Python-3.6 & wxPy-4.0, Py-2.7 & wxPy-3.0.2, Windows/Mac/Linux).
>
> If wxPython is actually used, then I think the move to wxPy 4 (aka
> wxPhoenix) will be of great assistance. Robin dropped the `hack.pth`
> stuff and lot of other legacy hacks, it can be installed standalone,
> etc.
>
> --
> You received this bug notification because you are subscribed to KiCad.
> Matching subscriptions: OS X KiCad bugs
> https://bugs.launchpad.net/bugs/1729259
>
> Title:
> Cannot close windows on macOS Sierra 10.12.6
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1729259/+subscriptions

Revision history for this message
Brendan Simon (brendan-simon) wrote :

Oops. Spoke too soon. I forgot to undo the moving of `/usr/local/bin` and `/usr/local/lib`.

My script does not solve the problem :( Sorry for the noise ... sigh ...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.