I use Mac OS X Lion
and Python 2.7
. I am new to python. Can anyone tell me how to import
AppKit
and PyObjC
to Python
. But i get the errors when trying to import Import Error: No module named AppKit
or 'Import Error: No module named PyObjC
.
Trying easy_install
does not help either.
What can i do to import these 2 modules?
If not already installed, install pip
by running:
sudo easy_install pip
Then run:
## install for all users
sudo pip install pyobjc
or
## install for current user only
pip install pyobjc --user
NOTE: the general recommendation is to avoid using the system python, and use instead a user-maintained version, for example installed via
brew install python3
,macports
,conda
or whatever you already use for third party dependencies.
If you're on Mac it could be you're using the incorrect pip version, try sudo pip3 install -U pyobjc that solved it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With