這整個故事很簡單, 就是在macos想用python放mp3, 就裝了playsound這個lib.

然後一跑發現需要AppKit, 就跑去用pip安裝, 安裝好一跑就說需要pyobjc, 然後裝上去後就會噴這個錯誤:

No module named 'AppKit'

網路上的資源都是叫你reinstall pyobjc, 但是真正的解法是把AppKit移除掉.

因為PyObjC已經包含 AppKit , Pypi上面那個不知道是哪來的 (他的說明也是Unknown).

淦...


Simple story, just want to play mp3 file in macos by python, so installed playsound.

After install, the exception said need module AppKit, okay, install it by pip.

Then said need the module pyobjc, no problem, also install it by pip.

Now the error became

No module named 'AppKit'

Most solution in internet is reinstall pyobjc, but the real solution for me is uninstall AppKit

The reason is that pyobjc already incloud AppKit, and the AppKit in pypi is unknown package...



Comments

comments powered by Disqus