8

I am trying to create another virtual environment (I already installed one using the typical instructions found here: http://docs.python-guide.org/en/latest/dev/virtualenvs/) so I run:

$ virtualenv experimental

-> The program 'virtualenv' is currently not installed. You can install it by typing: sudo apt install virtualenv

I checked to see if perhaps the program needed to be updated:

$ pip install virtualenv --upgrade

-> Requirement already up-to-date: virtualenv in /home/uniside/.local/lib/python2.7/site-packages

Any ideas about what is going on here?

3 Answers 3

17

Use sudo. Currently it's being install in your local directory.

sudo pip install virtualenv
2
  • 1
    how would you run the one inside the local directory? I have the same problem and when adding the .local/lib/python2.7/site-packages to my PATH variable, it still doesn't recognize it.
    – jimijazz
    Commented Oct 18, 2016 at 0:32
  • 2
    Accept the answer mate or I'm calling the police.
    – igneosaur
    Commented May 17, 2017 at 11:37
3

The answer by @khrm didn't worked for me.

I was able to do this with :

sudo apt install virtualenv
1

I had problems activating my virtualenv projects with Ubuntu's system version, so I just use pip's virtualenv. Works with python2 as well:

$ pip3 install virtualenv

Just call virutalenv via python3 -m:

$ python3 -m virtualenv --help
Usage: virtualenv.py [OPTIONS] DEST_DIR

Not the answer you're looking for? Browse other questions tagged or ask your own question.