0

Hello I am getting following error during virtualenv creation. Here is the error:

$ mkvirtualenv cv
ERROR: virtualenvwrapper could not find /usr/local/bin/virtualenv in your path

Before this I was getting some weird message during the run of following commands:

sudo python get-pip.py
sudo pip install virtualenv virtualenvwrapper

Here is the weird message:

The directory '/home/myusername/.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/myusername/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

If I run this command sudo apt install virtualenv or virtualenvwrapper then I don't get the above weird message. but this don't help me to create virtualenv

python path is /usr/bin/python

Can anybody help me to figure out the issue by providing detailed command?

phd
  • 82,685
  • 13
  • 120
  • 165
  • The similar questions were asked before. I understand this question is not directly related to programming. It is not completely out of the context also. – Innovator-programmer Jul 21 '17 at 16:18
  • I have just gone through the link what I can ask questions in stackoverflow. It is mentioned that question related software tools used by programmer can be asked. I hope this question is relevant based on that . – Innovator-programmer Jul 21 '17 at 16:26
  • 1
    Possible duplicate of [Virtualenv Command Not Found](https://stackoverflow.com/questions/31133050/virtualenv-command-not-found) – jopasserat Jul 21 '17 at 16:57

1 Answers1

1

First, let's clear your "weird" message. It means that you've already used sudo -H before and sudo changed ownership for some of your files to root. Take the files back with the command

sudo chown -R myusername /home/myusername

(change myusername to your real login name; I used the name you've used in your question.)

After that upgrade pip and follow installation instructions for virtualenv and virtualenvwrapper:

sudo pip install -U pip setuptools virtualenv virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh
phd
  • 82,685
  • 13
  • 120
  • 165