plyer
plyer copied to clipboard
Filechooser doesn't work on Mac
When trying to use plyers filechooser:
import plyer as pl
path=pl.filechooser.open_file()
I get the following error:
File "/Users/user/Documents/GitHub/PigBrain/loader.py", line 24, in load_mat_file
path=pl.filechooser.open_file()
File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/plyer/facades/filechooser.py", line 50, in open_file
return self._file_selection_dialog(mode="open", *args, **kwargs)
File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/plyer/facades/filechooser.py", line 70, in _file_selection_dialog
raise NotImplementedError()
NotImplementedError
Using macosx Python 3.8.8
I can confirm. Tried this on macosx, python 3.10, and got the same error.
Works fine on mine. No errors. Macosx, python 3.9.9.
When trying to use plyers filechooser:
import plyer as pl path=pl.filechooser.open_file()
I get the following error: File "/Users/user/Documents/GitHub/PigBrain/loader.py", line 24, in load_mat_file path=pl.filechooser.open_file() File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/plyer/facades/filechooser.py", line 50, in open_file return self._file_selection_dialog(mode="open", *args, **kwargs) File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/plyer/facades/filechooser.py", line 70, in _file_selection_dialog raise NotImplementedError() NotImplementedError
Using macosx Python 3.8.8
I get the exact same error on macOS
Even I get the same issue on Mac
I can confirm, I've got the same issue on macOS / Python 3.10.3
I fixed this error, we need to pip install pyobjus
.
Afaik, someone is working with including pyobjus on mac instalations
Same error (Mac M1, Python 3.10, kivy 2.1, kivymd 1.1.1) occurs even with installed pyobjus, but only after packaging with pyinstaller. App just crashes :(
+1 on having this error only after pyinstaller
flueky
This worked for me. Using pyenv 3.11.2
My reading of the above is that this has been solved by installing the necessary packages.
I am going to close as completed, but if you have installed pyobjus
and it still doesn't work, let us know.
If this is only happening after creating a pyinstaller build, make sure you have added a hidden import like this
--hidden-import plyer.platforms.macosx.filechooser
other than that, for me this happens when I import AppKit in my code or use some other library that uses AppKit.