0

The image is a screenshot of the error which i am getting while this command in ubuntu-

$ sudo pip install virtualenv

The directory '/home/asha/.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.
The directory '/home/asha/.cache/pip/http' or its parent directory is not owned by the current user and caching wheels has been disabled. check permission and owner of that directory. if executing pip with sudo, you may want sudo's -H flag. 
Requirement already satisfied: virtualenv in ./.local/lib/python2.7/site-packages""

screenshot

  • No link to the image. – Zeiss Ikon Aug 08 '18 at 12:31
  • 1
    The message is self explanatory, "The directory '/home/asha/.cache/pip/http' or its parent directory is not owned by the current user " so what are the ownership and permissions of /home/asha/.cache/pip/http ? chown them to you user, see https://help.ubuntu.com/community/FilePermissions and / or https://askubuntu.com/questions/83/how-do-file-permissions-work . We can not give more specific advice with what little you posted – Panther Aug 08 '18 at 14:35
  • Thank you Panther for your input, I checked the owner and user of the directories, both owner and user of the directories are same and it has drwx privilege so i tried chmod command and gave both rwx privilege ie. drwxrwxr-- but still its not working and giving the same error. – BestWay Aug 08 '18 at 18:07
  • This should work sudo chown asha:asha -R /home/asha/.cache – Panther Aug 09 '18 at 06:09
  • I've just edited the question to show the screenshot you posted, and it shows a totally different command giving that output. Please [edit] to clarify. – wjandrea Aug 09 '18 at 21:09
  • Thank u wjandra for the screenshot, I'm new user here when i posted the question for the first time i thought the screenshot will appear and my question would be clear to all, but images were not suppose to upload so i typed the error, "$virtualenv -p /user/bin/python3.4 venv" was on my mind unfortunately i typed it along with the error i got.. Apology for that. – BestWay Aug 10 '18 at 04:06
  • I tried "sudo chown asha:asha -R /home/asha/.cache" as Panther have suggested but didn't work. Actually python2 was default one i was trying to work on python3 and python2 already had virtualenv installed i was trying to install again using python3 and that's how the error poped up. – BestWay Aug 10 '18 at 04:31