Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Django using brew?

How can Homebrew be used to install Django? How can Homebrew be used to install tools like setup-tools in python? What all packages can be installed using Homebrew?

like image 915
Sahil Babbar Avatar asked Mar 18 '15 19:03

Sahil Babbar


2 Answers

Homebrew doesn't package Django. You should install Django using Python's package manager, pip:

$ pip install Django
like image 193
mipadi Avatar answered Oct 19 '22 21:10

mipadi


Using pip to install Django is very convenient and should only take a few seconds using the instructions below. However, be careful you use the correct pip depending on whether installing on an older version of Python (2.7 or lower), or Python 3+. You may have python & python3 installed, and therefore wish to distinguish between pip and pip3.

For instance, locally I have:

$ pip --version
pip 1.2.1 from /Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)

$ pip3 --version
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)

Depending on which version you are installing to:

$ pip install Django  

or

$ pip3 install Django

To test the install was successful (here I installed with pip3, hence running python3 command):

$ python3
Python 3.4.2 (default, Jan 19 2015, 22:35:23)
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.get_version())
1.8.6
>>>

That's it!

like image 32
arcseldon Avatar answered Oct 19 '22 20:10

arcseldon