jaredks / rumps

Ridiculously Uncomplicated macOS Python Statusbar apps
BSD 3-Clause "New" or "Revised" License
3.06k stars 177 forks source link

AppKit depreciated - ImportError: cannot import name 'NSApplication' from 'AppKit' #200

Open TheBuzzer67 opened 1 year ago

TheBuzzer67 commented 1 year ago

Is there someone working to update the AppKit issues

import rumps File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/rumps/init.py", line 26, in from .rumps import (separator, debug_mode, alert, application_support, timers, quit_application, timer, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/rumps/rumps.py", line 15, in from AppKit import NSApplication, NSStatusBar, NSMenu, NSMenuItem, NSAlert, NSTextField, NSSecureTextField, NSImage, NSSlider, NSSize, NSWorkspace, NSWorkspaceWillSleepNotification, NSWorkspaceDidWakeNotification ImportError: cannot import name 'NSApplication' from 'AppKit' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/AppKit/init.py)

SKaplanOfficial commented 1 year ago

There's a pip module called AppKit that has no relation to PyObjC that, if installed, would cause this issue. If you haven't solved it already (or for others who come across this issue in the future), uninstall AppKit and force reinstall PyObjC-core, i.e.: pip uninstall AppKit then pip install --upgrade --force-reinstall PyObjC PyObjC-core

knurl commented 11 months ago

The comment above (https://github.com/jaredks/rumps/issues/200#issuecomment-1475380684) solved this for me.