Appears to be installing Django 1.3.1 in Ubuntu 12.04. How can I get Django 1.6 installed?
sudo apt-get install python-django
Appears to be installing Django 1.3.1 in Ubuntu 12.04. How can I get Django 1.6 installed?
sudo apt-get install python-django
While you can install it manually (setup.py
), I recommend using the Python package manager as it is easier to install, maintain and upgrade.
Install Pip, the Python package manager.
sudo apt-get install python-pip
Optionally, but recommended, upgrade pip
, using itself:
sudo pip install -U pip
Install the latest stable version of Django:
sudo pip install Django
This installs 1.6.2 at the time of writing(check here the latest pypi version).
To install a specific version, add a requirement specifier like this:
sudo pip install Django==1.6.2
Note that APT, the Debian/Ubuntu package management will still report the older version installed and it is still installed as well. APT installs in dist-packages paths while Pip installs in the site-packages paths. The latter takes precedence, so that's locally installed packages will be chosen. See also: What's the difference between dist-packages and site-packages?
First remove the previously installed django 1.3.1 version by deleting the django
folder inside /usr/local/lib/pythonx.x/dist-packages
(x.x denotes the version of python).Then follow the below steps,
Download Django 1.6 from here.
Open the terminal and move to the directory where you placed the Django 1.6
.
cd path/to/driectory/which/contains/django1.6.tar.gz
Extract the django1.6.tar.gz
by running the below command.
tar -xzvf Django-1.6.tar.gz
Move to the Django-1.6
directory
cd Django-1.6
Run the below command to install Django-1.6
sudo python setup.py install
sudo pip install
is a bad practice, which may work for django but can really screw up someone's system in other situations. Don't undermine the advantages of having Ubuntu manage your packages. The clean way to do it is with virtualenvwrapper. – nealmcb Aug 20 '14 at 03:56