Opened 9 years ago

Closed 7 years ago

#48849 closed defect (fixed)

MyPaint, MyPaint-devel: ImportError: No module named AppKit

Reported by: bunk3m (Bunk3m) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: su-v
Port: MyPaint, MyPaint-devel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Thought I should let you know that MyPaint-devel @1.2.0-beta.20150828+git.04511511_0 crashes on start.

I'm not sure how to debug to provide more info to track down what's happening but I'm happy to help if you have time to guide me through that.

The error I get from the Console app is:

2015-09-13 11:19:48.143 AM com.apple.xpc.launchd[1]: (com.github.mypaint.mypaint.MyPaint.5712[15553]) Service exited with abnormal code: 1

Attachments (1)

patch-MyPaint-devel-i18n.diff (2.6 KB) - added by su-v 9 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by bunk3m (Bunk3m)

I've tried a few things and hope these may be helpful in determining what the problem is:

  1. tried to run from the commandline and got this output
    MyPaint
    INFO: mypaint: Installation layout: conventional POSIX-like structure with prefix u'/opt/local'
    Traceback (most recent call last):
      File "/opt/local/bin/MyPaint", line 450, in <module>
        init_gettext(localepath, localepath_brushlib)
      File "/opt/local/bin/MyPaint", line 255, in init_gettext
        lib.i18n.set_i18n_envvars()
      File "/opt/local/share/mypaint/lib/i18n.py", line 103, in set_i18n_envvars
        from AppKit import NSLocale
    ImportError: No module named AppKit
    
  1. I've tried to start using ctrl-click on the MyPaint icon thinking that perhaps gatekeeper was doing something. There is no dialog box about new app allowed to run and the error msg is same as above.
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: MyPaint-devel removed
Owner: changed from macports-tickets@… to ryandesign@…

When an app crashes, OS X creates a crash log file in the folder ~/Library/Logs/DiagnosticReports/. If you could attach the log file corresponding to this crash, that might give an idea of what happened.

However, the additional information you provided in comment:1 might already be enough for someone who understands MyPaint's code to figure this out. I am not such a person; you may want to report this problem to the developers of MyPaint, since the problem does not happen for me.

comment:3 Changed 9 years ago by bunk3m (Bunk3m)

THanks for your help. Glad to hear it works on your machine.

I checked the folder ~/Library/Logs/DiagnosticReports/ and there are no reports at all from the day of the crash. That is weird. The only report is in the console.app but only the one line.

I had no luck with regular MyPaint either. But I see there is an upstream issue from one of the bug reports.

I've posted bug reports with the devs on github in the past. It was frustrating and pointless.

Last edited 9 years ago by bunk3m (Bunk3m) (previous) (diff)

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Let's check some basics.

Have you installed Xcode, and opened it at least once? What version?

Have you installed the Xcode command line tools?

What's the output of:

xcodebuild -version
clang -v

comment:5 Changed 9 years ago by bunk3m (Bunk3m)

Thanks Ryan,

I'm running OS10.10.5 and most recent version of Xcode.

Here is the output:

xcodebuild -version
Xcode 6.4
Build version 6E35b
clang -v
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Last edited 9 years ago by bunk3m (Bunk3m) (previous) (diff)

comment:6 Changed 9 years ago by su-v

Same error:

Traceback (most recent call last):
  File "/Volumes/magenta/mp-trunk/x11/bin/mypaint", line 462, in <module>
    init_gettext(localepath, localepath_brushlib)
  File "/Volumes/magenta/mp-trunk/x11/bin/mypaint", line 267, in init_gettext
    lib.i18n.set_i18n_envvars()
  File "/Volumes/magenta/mp-trunk/x11/share/mypaint/lib/i18n.py", line 103, in set_i18n_envvars
    from AppKit import NSLocale
ImportError: No module named AppKit

reproduced on OS X 10.7.5 with MyPaint-devel @1.2.0-beta.20150801+git.58c1dbba and 1.2.0-beta.20150828+git.04511511.

It seems that upstream changes for i18n would require new dependencies of the MyPaint-devel port for additional python modules (likely py27-pyobjc-cocoa).

Attempts to test this by installing py27-pyobjc-cocoa have not been successful on OS X 10.7.5 though: import AppKit in an interactive python session causes MacPorts' Python 2.7.10 itself to crash immediately. Possibly this crash (unrelated to MyPaint-devel) is an issue specific for latest pyobjc on older versions of OS X - I did not find a related ticket in MacPorts so far.

Last edited 9 years ago by su-v (previous) (diff)

comment:7 Changed 9 years ago by su-v

Cc: suv-sf@… added

Cc Me!

Changed 9 years ago by su-v

comment:8 Changed 9 years ago by su-v

The attached diff for MyPaint-devel adds a patch for lib/i18n.py to check the success of importing AppKit at runtime (it will fall back to POSIX locale if NSLocale from AppKit fails to import).

Additionally the diff adds a new variant to MyPaint-devel: nslocale. The variant could be used for testing locale support via AppKit/NSLocale on more recent versions of OS X - the variant simply adds py27-pyobjc-cocoa to the depends_lib [*].

--
[*] The diff was successfully tested on OS X 10.7.5 without AppKit module installed for MacPorts' Python 2.7 - I did not manage to get py27-pyobjc-cocoa working (importing AppKit crashes the main python process on Lion).

comment:9 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

MyPaint 1.2.0 has been released. Please test with that version, and if the problem persists, please report the problem to the developers of MyPaint so they can resolve it.

comment:10 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Port: MyPaint added
Status: newassigned
Summary: MyPaint-devel crashes on startMyPaint, MyPaint-devel: ImportError: No module named AppKit

Issue still exists in 1.2.0 and was reported to the developers here.

Workaround is:

sudo port install py27-pyobjc-cocoa

comment:11 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.