The directory '/home/XXX/.cache/pip/http' or its parent directory is not owned by the current user 出...

WARNING: The directory '/home/ssozh/.cache/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.

 

大概是由于pip需要建立缓存,因此在你的$HOME/XXX文件夹下建立了.cache/pip的文件夹。默认权限是drwx------。但我想进入这个文件夹却出现了拒绝访问,这个显然是不科学的,我一气之下删除了这个文件夹,然后重新执行pip list,这个文件夹又重新出现了,这次就不再出现上面的文字了。也不需要使用sudo -H。(毕竟你在该用户下使用虚拟环境也没有办法使用sudo -H)

 

转载于:https://www.cnblogs.com/SsoZhNO-1/p/11188898.html

你可能感兴趣的:(python)