导入错误:没有名为AppKit的模块 [英] Import Error: No module named AppKit
问题描述
我使用 Mac OS X Lion
和 Python 2.7
.我是python的新手.谁能告诉我如何 import
AppKit
和 PyObjC
到 Python
.但是在尝试导入 Import Error:No module named AppKit
或' Import Error:No module named PyObjC
.
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
.
尝试 easy_install
也无济于事.
如何导入这两个模块?
推荐答案
如果尚未安装,请通过运行以下命令安装 pip
:
If not already installed, install pip
by running:
sudo easy_install pip
然后运行:
## install for all users
sudo pip install pyobjc
或
## install for current user only
pip install pyobjc --user
注意:一般建议是使用系统python避免避免,而应使用用户维护的版本,例如通过
brew install python3 安装code>,
macports
,conda
或您已经用于第三方依赖项的任何内容.
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.
这篇关于导入错误:没有名为AppKit的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!