kornelski / ImageAlpha

Mac GUI for pngquant, pngnq and posterizer
https://pngmini.com
GNU General Public License v2.0
470 stars 63 forks source link

PyObjC program failed to start #20

Closed jhuebsch closed 9 years ago

jhuebsch commented 9 years ago

I get the following message when trying to run ImageAlpha. error Both beta 1.40 and stable 1.3.5

My machine is running OS X 10.10.3 (14D136) Python 2.7.6 (default, Sep 9 2014, 15:04:36)

There are no errors appearing in Console.app when this occurs.

kornelski commented 9 years ago

There are no errors appearing in Console.app when this occurs.

:( that makes it difficult.

Please try running it from Terminal:

/Applications/ImageAlpha.app/Contents/MacOS/ImageAlpha
jhuebsch commented 9 years ago

That gives me the following error message:

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import objc
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/__init__.py", line 28, in <module>
    from objc._bridgesupport import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 13, in <module>
    import pkg_resources
ImportError: No module named pkg_resources
kornelski commented 9 years ago

Sorry, I don't know what pkg_resources is. It's not used by the app directly. It seems that your system's installation of Python is broken.

jhuebsch commented 9 years ago

I'll look into repairing python. I do not recall ever messing with the install but now I have a direction to investigate. Thank you.

jhuebsch commented 9 years ago

Just posting this here incase someone else has this problem. I made sure I didn't have any other versions of python installed (via home-brew etc) and then manually reinstalled pip https://pip.pypa.io/en/latest/installing.html

vinniejames commented 8 years ago

Having the same trouble on MacOS 10.12.1, Python 2.7.12 (Homebrew)

$ /Applications/ImageAlpha.app/Contents/MacOS/ImageAlpha
Traceback (most recent call last):
  File "main.py", line 20, in <module>
    import ImageAlphaDocument
  File "/Applications/ImageAlpha.app/Contents/Resources/ImageAlphaDocument.py", line 7, in <module>
    import IAImageView
  File "/Applications/ImageAlpha.app/Contents/Resources/IAImageView.py", line 7, in <module>
    from Quartz.CoreGraphics import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Quartz/__init__.py", line 82, in <module>
    _load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Quartz/__init__.py", line 20, in _load
    from Quartz import CoreGraphics as m
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Quartz/CoreGraphics/__init__.py", line 108, in <module>
    _load(mod)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Quartz/CoreGraphics/__init__.py", line 41, in _load
    import Quartz.CoreGraphics._callbacks as m
RuntimeError: Wrong version of PyObjC C API
kornelski commented 8 years ago

I'm afraid you can't have homebrew python. The app requires PyObjC, which is very system-dependent and I wouldn't be surprised if it only worked with python shipped with the OS.

vinniejames commented 8 years ago

That's unfortunate because macOS python is having its own trouble which is why I was forced to use homebrew

kornelski commented 8 years ago

If all else fails, you can use pngquant from command line.

vinniejames commented 8 years ago

Awesome, ill check it out :D

vinniejames commented 7 years ago

Installing PyObjC via pip got things working with the Homebrew Python version:

python2.7 -m pip install -U pyobjc-core python2.7 -m pip install -U pyobjc

benjigreig commented 6 years ago

@vinniejames, doing that worked for me too. ImageAlpha hasn't been working in a while. Thanks for the tip.

kornelski commented 6 years ago

If all else fails, you can compress images with pngquant using this: https://imageoptim.com/online