10

When i try to run the command:

sudo apt-get install virtualenv

The error I get in response is:

E: Unable to locate package virtualenv

Asif Mehmood
  • 964
  • 2
  • 14
  • 35
  • You need to install it with `pip` , if you haven't `pip` install with `sudo apt-get install python-pip` then do `sudo pip install virtualenv` – Mazdak Jan 31 '15 at 21:49
  • have a look to this question http://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-by-apt – Mazdak Jan 31 '15 at 22:01
  • Now it is giving the same error for the first command you told. @KasraAD – Asif Mehmood Jan 31 '15 at 22:03
  • if you are sure that you have execute the command correctly the problem is for your package manager ! so go to current link to correct it ! – Mazdak Jan 31 '15 at 22:06
  • thanx very much. I will try and then come here – Asif Mehmood Jan 31 '15 at 22:13
  • I am confused. One after every dependant gives an error of unable to locate for each proceeding file to be installed. What to do now, please. Thanx in advance. @KasraAD – Asif Mehmood Jan 31 '15 at 23:18
  • Yess, if any one wants to have a look at ( installing virtualenv: a basis for the installation of ) django installation, please run this command when the shell opens up in Ubuntu: sudo apt-get install python-setuptools and then: sudo apt-get install python-easy_install virtualenv and then run the commands to simply start the instructions followed on the following link(starting from the section "Setting up a new environment"): http://www.django-rest-framework.org/tutorial/1-serialization/ – Asif Mehmood Feb 01 '15 at 00:03

7 Answers7

18

The Ubuntu package is called python-virtualenv, not "virtualenv".

Benargee
  • 162
  • 1
  • 2
  • 8
  • 12
    if calling `sudo apt-get install python-virtualenv` you see an error `Package python-virtualenv is not available` than call `sudo apt-get update` firstly – Alex Smirnov Aug 09 '18 at 21:38
13

Try This :

sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install virtualenv
Rashid Obaidi
  • 154
  • 1
  • 5
8

It's also possible that you may not have run sudo apt-get update. It worked for me.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
ARK
  • 171
  • 2
  • 2
4

You need to add python before virtualenv because ubuntu package is python-virtualenv not virtualenv.

sudo apt-get install python-virtualenv
Mahfuz
  • 1,335
  • 1
  • 13
  • 16
2

you can install it with this instruction :

curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz
tar xvfz virtualenv-1.10.1.tar.gz
cd virtualenv-1.10.1
sudo python setup.py install
Maryam Homayouni
  • 905
  • 9
  • 16
2
sudo apt-get update
sudo apt-get install virtualenv
Susaj S N
  • 960
  • 1
  • 10
  • 22
-1

Yess, if any one wants to have a look at ( installing virtualenv: a basis for the installation of ) django installation, please run this command when the shell opens up in Ubuntu:

sudo apt-get install python-setuptools
sudo apt-get install python-easy_install virtualenv

and then run the commands to simply start the instructions followed on the following link(starting from the section "Setting up a new environment"): http://www.django-rest-framework.org/tutorial/1-serialization/

Asif Mehmood
  • 964
  • 2
  • 14
  • 35