【发布时间】:2025-12-07 18:40:01
【问题描述】:
我写了这个命令来安装 NLTK python 模块:
sudo pip install -U nltk
第一次它似乎运行良好,但当我想测试它时,它没有。所以我重写了命令然后我得到了
The directory '/Users/apple/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
我尝试了所有可能的 chown 命令,但我不知道我还能做些什么。我使用 Mac OS X 10.9.5。
【问题讨论】:
-
我安装了它,但是当我想创建一个像 virtualenv corpus 这样的环境时,它说 -bash: virtualenv: command not found
-
请参阅我的答案以获得指导。
-
@starckman 请发布您遇到的问题,表明您在
sudo pip install -U nltk的初始尝试没有正常工作。
标签: python import module pip sudo