Zim

Sierra has broken zim

Bug #1633812 reported by Frost
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Zim
Confirmed
Undecided
Unassigned

Bug Description

Not so much a bug, but I recently updated my mac os to Sierra 10.12 and now zim is broken. I don't know whether it's that python will no longer run, or just zim, or both.

Either way, zim no longer works.

Tags: mac sierra
Revision history for this message
Peter (st1234s) wrote :

I have the same problem. I updated to MacOS Sierra and then when I start zim I get the error message:
Python quit unexpectedly while using the libgdk-quartz-2.0.0.dylib plug-in.

Any idea what I could try?

Revision history for this message
Frost (lapsang-leaf) wrote :

I think it's python, but when I went to the official python community and asked for 'plain instructions' they said they don't provide that and to go somewhere else like stackoverflow. They did have a solution there, but I did not have the technical understanding to decipher it. I didn't find them very friendly, but hey-ho.

Haven't had the time to find a more user-friendly explanation, but check out stackoverflow, or I will, and maybe we can report back here?

Revision history for this message
Peter (st1234s) wrote :

I have some technical background. I could try to understand this. But I could not find the stackoverflow article that you refer to. Could please post a pointer to it?

Thanks,
Peter

Revision history for this message
Frost (lapsang-leaf) wrote :

stackoverflow *might* have a more user friendly article, is what I was saying, but I haven't searched for it yet.

Techie cousins over at python, however, came up with this: https://bugs.python.org/issue27806

If you can translate into plain English please do let me know :)

Revision history for this message
Jeff Templon (jaytee32) wrote :

Plain English appears to be, that apple changed something with regards to quicktime. as long as the python program doesn't try to do anything with quicktime, it will work (so python itself is not "broken". However as someone pointed out earlier, the version of libgdk-quartz in homebrew (from homebrew package gtk+) seems to expect the old behavior (pre 10.12) and so it fails.

At least, this is what that bug you pointed to suggests. I am trying to recompile gtk+ from source right now, if this works for me I will post about it here.

Revision history for this message
Jeff Templon (jaytee32) wrote :

Hi,

The errors I got were these:

15 libgdk-quartz-2.0.0.dylib 0x000000010e8d9ec2 poll_func + 172
16 libglib-2.0.0.dylib 0x000000010d76f907 g_main_context_iterate + 326
17 libglib-2.0.0.dylib 0x000000010d76fbb4 g_main_loop_run + 207
18 libgtk-quartz-2.0.0.dylib 0x000000010e5ae3d6 gtk_main + 180
19 _gtk.so 0x000000010e2a3f78 _wrap_gtk_main + 243

So I rebuilt gtk, glib, and gtk+ from scratch via homebrew. The resulting python (plus modules) still did not yield a working zim. I am now trying to install all dependencies from source, if that doesn't work then I give up until somebody fixes the python / gtk stuff ... I've already spent a couple hours on this.

Revision history for this message
Jeff Templon (jaytee32) wrote :

same error. sorry.

I am not plugged into the homebrew / gtk / python communities. If you reading this are, could you politely ask them for a fix?

Jeff Templon (jaytee32)
Changed in zim:
status: New → Confirmed
Revision history for this message
Frost (lapsang-leaf) wrote :

Yeah, guys, I just don't speak *this* level of code. I know enough to determine which are the good articles so I can point these out, and I can maybe post some help requests on other forums, but that's all I can do. Saw something about updating from Xcode 7 to Xcode 8 but not quite sure how to go about that. I not connected to gtk communities though.

Let me know if any of these links get you to a fix:

https://stackoverflow.com/questions/38338206/homebrew-python-sqlite-not-building-on-macos-sierra#39129788
https://stackoverflow.com/questions/39619889/homebrew-fatal-needed-a-single-revision-macos-sierra
https://github.com/Homebrew/homebrew-core/issues/3454
https://github.com/Homebrew/homebrew-core/pull/3134

Here's where you'll find the brew community: http://discourse.brew.sh/
There's also a new version of Homebrew (1.0.3) which might be a necessary upgrade?

Sorry I don't have the know-how to help more!

Revision history for this message
Jeff Templon (jaytee32) wrote :

Hi,

  Thanks for all the included links. Looking at them, it looks like to me, the correct issue is that 3454 with having to first delete everything (brew erase), then install Xcode, Xcode command tools, in specific ordering and not forgetting any steps. Blechh.

  What does work, and took me a lot less time:

1) create an Ubuntu VM in VirtualBox
2) install the owncloud client (my Zim files are shared between computers via Owncloud)
3) install Zim in the Ubuntu VM from the official .deb file on the website.

Probably took me all of 30 minutes compared to the hours of digging around, compiling, installing etc this morning. I guess at some point the brew packages will "just work" again, I can consider going back to the native Mac stuff then.

Revision history for this message
Jeff Templon (jaytee32) wrote :

Well I tried it anyway, uninstalling python and re-installing xcode and whatnot:

Looking at this link

https://github.com/Homebrew/homebrew-core/pull/3134

Check xcode by running it as mac app ... it asks for password to make changes and then installs some components, so maybe xcode was not completely ready yet?

Then sudo xcode-select --reset
Then downloaded command line tools from developer site; not clear that this is any different from what I already installed, did it anyway.

then

brew install sqlite
brew install python
pip install setuptools --upgrade

realized that I was still maybe pointing to the system python as pip was run, so deinstalled python (brew uninstall python --force) and then reinstall, then before running pip, do a rehash to get right python in the path.

brew install python
rehash
pip install setuptools --upgrade
   note this picked up a different version of setuptools!
also did brew linkapps python

next

brew install gtk-mac-integration
/usr/local/bin/pip install pyxdg

and then

/usr/local/bin/python zim.py

exactly the same errors:

15 libgdk-quartz-2.0.0.dylib 0x000000010d4bed1e poll_func + 172
16 libglib-2.0.0.dylib 0x000000010c3557ae g_main_context_iterate + 326
17 libglib-2.0.0.dylib 0x000000010c355a5b g_main_loop_run + 207
18 libgtk-quartz-2.0.0.dylib 0x000000010d1946e6 gtk_main + 180
19 _gtk.so 0x000000010ce89f78 _wrap_gtk_main + 243

we'll have to wait for fixed versions.

Revision history for this message
Jeff Templon (jaytee32) wrote :

Hi,

what is you are pasting? that doesn't look like an error, it looks like the zim.py script. To be completely clear about my error, it's like this:

/usr/local/bin/python zim.py

(still in the source directory, I didn't make it as far as installing yet)
When I do this, a window pops up "Python quit unexpectedly". Button under that says "Report ...", if I click that, I can see lots of details about what went wrong ... the lines about gtk are found there.

Revision history for this message
Peter (st1234s) wrote :

I also gave up and just installed Zim in Ubuntu on VirtualBox. Works for me so far.

Revision history for this message
Dennis Kaptain (dkaptain) wrote :

This looks like the same bug I reported here:
https://bugs.launchpad.net/zim/+bug/1638740

There's a lot of details included there.

Revision history for this message
Frost (lapsang-leaf) wrote :

I'm not interested in running a virtualbox. I already have Parallels and know of the many windows-based encyclopaedia software options. If I find the time I will see if I can get my head around this. If not I just really, really hope that either a user or dev comes up with a fix.

Revision history for this message
Frost (lapsang-leaf) wrote :

I think this latest update will have python working, my python launcher now runs fine, but it still won't open my zim file.

https://www.python.org/downloads/release/python-2712/

Revision history for this message
Luke Hagan (lhagan) wrote :

As a laptop user, VirtualBox (or Parallels) isn't a great solution -- the battery life hit is significant if you want to keep Zim running all the time. So far, I've had good luck running the Windows version of Zim in Wine using Crossover ($60, https://www.codeweavers.com) or WineBottler (free, http://winebottler.kronenberg.org). Wine is a compatibility layer, not a VM, so you don't get the kind of power consumption that comes with running a second OS.

Revision history for this message
Frost (lapsang-leaf) wrote :

Wine bottler looks really interesting. I haven't had luck with it though - could you provide brief installation instructions (once Wine is downloaded)? I have all the files necessary but am not experienced with Wine and advanced installation procedures - I am sure lots of people would be very grateful if you could briefly post how you set it up... :)

Revision history for this message
Luke Hagan (lhagan) wrote :

Sure, happy to help out. Here are my steps:

1. Download WineBottler 1.8-rc4 from http://winebottler.kronenberg.org/downloads
2. Download Zim 0.65 Windows desktop installer from http://www.glump.net/software/zim-windows
3. Mount the WineBottler disk image and drag both the Wine and WineBottler apps to your Applications folder
4. Open the WineBottler app
5. Click the "Advanced" icon at the top of the WineBottler window and make the following selections:
- Click the "select File..." button and select the Zim-setup-0.65_2016-01-18.exe you just downloaded
- "System Version Info" = 7
- Deselect the "Include Mono" and "Include Gecko" checkboxes
6. Click the "Install" button and save as "Zim" in your Applications folder
7. Follow the Zim install wizard prompts, keeping the default settings
8. At the end of the install wizard, deselect "Run Zim Desktop Wiki" and click Finish
9. In the Select Startfile dialog, make sure Program Files/Zim Desktop Wiki/zim.exe is selected (it should be by default) and click OK
10. Go to Applications and open the Zim app
11. Select your notebook folder -- default folder selection will be inside the Zim Winebottle you just created, so you need to select the "/" at the bottom of the Places list in order to access your Mac's filesystem

The only limitations I've encountered with this setup are:
- Zim is rendered at non-retina resolution, so it looks a little blurry on my retina screen
- You can only copy/paste text, not images (Crossover does not have this problem)

Revision history for this message
Frost (lapsang-leaf) wrote :

This is really excellent, best suggestion so far. Thank you.

I realised why I could not get it to work beforehand - I was trying to use the portable and not desktop version of Zim.

Note to all: if you are going to try the Wine method you need to use the Desktop version. :)

I also have a sneaky feeling that you need to install the inbuilt python interpreter into Wine. I did this before using Hagan's method above so cannot confirm whether it was necessary or not, but I suspect it is.

Revision history for this message
Peter (st1234s) wrote :

The WineBottler solution is great. Thank you very much.

BTW: I did not need to install any python interpreter.

Revision history for this message
Leon (lschuermann) wrote :

I'm a really big fan of Zim and recently switched from running Linux on my MacBook to macOS, as Linux had a worse battery-life and made it run hot all the time. Now, I get the same errors.

During startup, I noticed, that in verbose on macOS Zim prints the following:
INFO: No VCS detected
INFO: Starting async index update
INFO: Accelerator changed for <Actions>/PageView/toggle_format_mark
/Users/leons/Downloads/zim-0.65/zim/gui/__init__.py:604: Warning: invalid cast from 'GtkMenuBar' to 'GtkWindow'
  macapp.set_menu_bar(menu_bar)
/Users/leons/Downloads/zim-0.65/zim/gui/__init__.py:604: GtkWarning: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
  macapp.set_menu_bar(menu_bar)
INFO: Open page: <FileStorePage: Home> (<FileStorePage: Home>)
INFO: Loading template from: <UnixFile: /Users/leons/Downloads/zim-0.65/data/templates/wiki/Default.txt>

After that, I get the python-crashed message.
Does this relate to the issue we're facing?

Revision history for this message
Frost (lapsang-leaf) wrote :

Hi Leon. You haven't said which version of Mac OS you are running. If it's not Sierra (10.12) then I suggest you open a new bug ticket.

But, no, to my knowledge nobody in this discussion had the issue that you publish...

Best open a new ticket?

Revision history for this message
Leon (lschuermann) wrote :

Hi, thanks for the quick reply!

I am currently on Sierra (10.12.2).

I just tried uncommenting all the mac-specific behaviour in zim/gui/__init__.py (the try-except-block) and don't get the error-message anymore. Sadly, Zim crashes anyways. So I think I'm back to the bug you and others are facing.

Revision history for this message
Frost (lapsang-leaf) wrote :

To summarise, I've got python working. It's working with other apps on my mac... but not Zim.

The devs need to get on that, but so far nothing.

In the meantime Hagan's suggesting of using Wine is pretty darn great as you can continue to use the Notebook you have already created on your mac hard drive, along with the fact that Wine is free.

I am pretty happy to sit tight until devs push an update. No hurry on my part now - I got a nice bottle of Wine keeping me company! :)

Revision history for this message
Patrick Bos (egpbos) wrote :

Hi all,

https://github.com/Homebrew/homebrew-core/issues/8022

A workaround is suggested here that works for me :) Start zim using the standalone flag:

python2.7 zim.py --standalone

I have it working this way both with the Macports Python 2.7 and with the macOS supplied Python with PyGTK for Mac as suggested on the Zim install guide (http://zim-wiki.org/install.html).

Revision history for this message
Frost (lapsang-leaf) wrote :

This is interesting, because it definitely exposes that the upgrade has broken the python locale. Since my python is otherwise working I'm quite confused; I don't think it's going to be as simple as moving the directory for some people. Or maybe it is?

Will watch the steps that people post here. In the meantime, happy with a glass of Wine. ;)

Revision history for this message
Jeff Templon (jaytee32) wrote :

I verify that it does work, although I get the following on the console:

simeto:zim-0.65> python zim.py --standalone
/Users/templon/tmp/zim-0.65/zim/gui/__init__.py:604: Warning: invalid cast from 'GtkMenuBar' to 'GtkWindow'
  macapp.set_menu_bar(menu_bar)
/Users/templon/tmp/zim-0.65/zim/gui/__init__.py:604: GtkWarning: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
  macapp.set_menu_bar(menu_bar)

perhaps this is at the root of the problem? Too bad that it took so long to find this, I'm now happily using orgmode in emacs ...

Revision history for this message
Lucas (lucaszago) wrote :

/usr/local/bin/python zim.py --standalone

Works like a charm!

Thanks Patrick

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.