Installing Django in non-default python version

A forum for general discussion of the Python programming language.

Installing Django in non-default python version

Postby bliss » Fri Oct 04, 2013 2:55 pm

Hi

I am a mac user and thus have python 2.7 by default.
I've used python3.3 installer for mac and now have python3.

To install python, I know the easiest way is to use the command line:
pip install Django

I've ran this after installing python 3.
I'm getting the following message:
Requirement already satisfied (use --upgrade to upgrade): Django in /Library/Python/2.7/site-packages
Cleaning up..

Python 2.7 is my default andit is where pip install Django is installing Django...
However, I want to have Django installed in Python 3 without having to use Python 3 as my default Python version.

How do I do this?
Is htere a way to tell pip to install it for python3 since python2 already has it???

Thank you very much...
bliss
 
Posts: 15
Joined: Thu May 09, 2013 3:42 am

Re: Installing Django in non-default python version

Postby stranac » Fri Oct 04, 2013 4:32 pm

You just install it with the pip you installed for python 3.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1093
Joined: Thu Feb 07, 2013 3:42 pm

Re: Installing Django in non-default python version

Postby bliss » Sat Oct 05, 2013 1:34 am

Hi

I've done:
pip install Django

but it says:
Requirement already satisfied (use --upgrade to upgrade): Django in /Library/Python/2.7/site-packages
Cleaning up..


Because I already have Django installed in python 2.7, but I want to install it for Python 3.
What to do?

Thanks
bliss
 
Posts: 15
Joined: Thu May 09, 2013 3:42 am

Re: Installing Django in non-default python version

Postby bliss » Sat Oct 05, 2013 2:25 am

Ok...
I've figured it out.
Posting it for other ppl.....

Download .tar file of django from:
https://www.djangoproject.com/download/

Then open the .tar file.
Go to the folder created for the tar file.

and instead of this command:
sudo python setup.py install

You change it to whatever version of python you want to install django in.
In my case it was python 3 so the code I used was:
sudo python3 setup.py install

That's it.

This is not using pip though....if there's a way to do this using pip...I'll be curious to know.....thank you...
:)
bliss
 
Posts: 15
Joined: Thu May 09, 2013 3:42 am

Re: Installing Django in non-default python version

Postby stranac » Sat Oct 05, 2013 8:26 am

stranac wrote:You just install it with the pip you installed for python 3.

So
Code: Select all
/path/to/pip/for/python3/pip install django
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1093
Joined: Thu Feb 07, 2013 3:42 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron