2

I am very new to Ubuntu OS and Python as well. I want to install Django. But i dont have easy_install and I tried below command to install pip

sudo apt-get install python-pip

I got an error as below

Unable to locate package python-pip

I tried below command as well

sudo apt-get install python-pip

and i got error as below

E: Package 'python-setuptools' has no installation candidate

I am very confused in installing django, How to successfully install django

n92
  • 7,424
  • 27
  • 93
  • 129
  • 3
    There is absolutely no reason to be using Ubuntu 11.10. It is three years old and *not supported since 2013*. You should upgrade to a stable version immediately. – Daniel Roseman May 14 '14 at 11:28
  • I would recommend you to use Ubuntu 12.04 because the end of life for this OS is April 2017 or else you can use Ubuntu 14.04 which the end of like is April 2019... every other version is getting to the end of the life for the product, check it here: https://wiki.ubuntu.com/Releases – Javier Vieira May 14 '14 at 11:38
  • @DanielRoseman Thanks for the suggestion, Its working now in 14.04 (latest version) – n92 May 15 '14 at 19:23
  • possible duplicate of [How do I install Django on Ubuntu 11.10?](http://stackoverflow.com/questions/9558078/how-do-i-install-django-on-ubuntu-11-10) – jww Aug 08 '14 at 04:15

3 Answers3

1

First update repositories

sudo apt-get update

then try

sudo apt-get install python-pip python-dev build-essential python-setuptools

if nothing, you can install pip and setuptools packages manually. Download them from PyPI.

MindHatter
  • 51
  • 2
1

Install pip

To install or upgrade pip, securely download get-pip.py.

Then run the following (which may require administrator access):

sudo python get-pip.py

If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.

To upgrade an existing setuptools (or distribute), run pip install -U setuptools

Upgrade pip

On Linux or OS X:

sudo pip install -U pip

Then you can download django using pip,

sudo pip install django
dhana
  • 6,487
  • 4
  • 40
  • 63
1

Install

First you need make sure you have Python install, here I take 2.7.6 as example. For how to install Python, you can go check this link:

https://askubuntu.com/questions/443048/python-2-7-6-on-ubuntu-12-04-how-to

Then you can start install Django and setup database as follow:

sudo apt-get install python-django
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb

You can find more configuration detail in this link

http://yuwenqing.org/?p=108

Also, for less pain in future develop, you should deploy your Django application in python virtualEnv, here are some detail of why you need virtualEnv.

http://yuwenqing.org/?p=126

Community
  • 1
  • 1
Wenqing Yu
  • 11
  • 1