Retome a propriedade da pasta cache do pip em seu diretório inicial usando este comando:
sudo chown -R anuj: /home/anuj/.cache/pip/
Depois disso, pip
deve parar de reclamar.
Para o futuro, nunca execute sudo pip
. Se você realmente precisar usar pip
para instalar pacotes Python globalmente para todos os usuários, use sudo -H pip
, para que ele use o diretório home do usuário root como cache.