作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我使用 Mac OS X Lion
和 Python 2.7
。我是 python 的新手。谁能告诉我如何import
AppKit
和PyObjC
到Python
。但是我在尝试导入时遇到错误 Import Error: No module named AppKit
或 'Import Error: No module named PyObjC
.
尝试 easy_install
也无济于事。
如何导入这两个模块?
最佳答案
如果尚未安装,请运行以下命令安装 pip
:
sudo easy_install pip
然后运行:
## install for all users
sudo pip install pyobjc
或
## 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.
关于python - 导入错误 : No module named AppKit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12767669/
我是一名优秀的程序员,十分优秀!