gpt4 book ai didi

python - 导入错误 : No module named AppKit

转载 作者:太空狗 更新时间:2023-10-29 22:05:01 25 4
gpt4 key购买 nike

我使用 Mac OS X LionPython 2.7。我是 python 的新手。谁能告诉我如何import AppKitPyObjCPython。但是我在尝试导入时遇到错误 Import Error: No module named AppKit 或 'Import Error: No module named PyObjC.

尝试 easy_install 也无济于事。 This is a screenshot when I run <code>easy_install PyObjC</code>

如何导入这两个模块?

最佳答案

如果尚未安装,请运行以下命令安装 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com