nltk install表示目录不属于当前用户,并且要求已经是最新的

时间:2018-09-06 23:05:16

标签: pip nltk sudo

我正在尝试使用sudo pip nltk安装nltk,但由于错误而停止:

The directory /users/$username/library/caches/pip/http or its parent directory is 
not owned by the current user and the cache has been disabled. 
The directory /users/$username/Library/Caches/pip or its parent directory is 
not owned by the current user and caching wheels has been disabled. 
Requirement already satisfied: nltk in /Library/Python/2.7/site-packages (3.3)
Requirements already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from nltk) (1.4.1) 

显示了这些错误消息,并且我是否已经拥有nltk并且是否为最新版本感到困惑。我检查了所有父目录的权限,并为所有目录设置了drwx,所以我很困惑为什么该消息仍然显示。

请帮助!我一直坚持这一点,而且我认为我在某些时候已经弄乱了我的系统Python。

1 个答案:

答案 0 :(得分:0)

使用sudo -H pip install -U nltk解决了该问题