texpilot
Posts: 2
Joined: Wed Dec 31, 2014 2:58 pm

python-pip installs python 2.6 when 2.7 is already installed

Wed Dec 31, 2014 3:18 pm

Greetings all,
I'm just getting started with Raspbian on my Pi model B+ and have had great success on a home theater automation project thus far. Now I'm moving deeper into the software layer to enable an AJAX capable front end.

I'm looking at working with Flask, which is installed via pip. When I install pip using:

Code: Select all

pi@htpi ~ $ python --version
Python 2.7.3
pi@htpi ~ $ sudo apt-get install python-pip
<...>
The following NEW packages will be installed:
  python-pip python-pkg-resources python-setuptools python2.6 python2.6-minimal
<...>
I'm surprised to find that it will install python 2.6, even though Raspbian already includes Python 2.7.3. To be complete, I'm looking to work with virtualenv and flask together, and both install Python 2.6 even when 2.7.3 is installed.

Can anyone tell me how to install virtualenv and python-pip and not let apt-get install python 2.6 at the same time?

If I should post this to another forum, I'll be glad to, but since package installation is more of a SysAdmin task, and per the Forum instructions, I'm starting here.

Many thanks and best regards,
Terry

User avatar
croston
Posts: 716
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: python-pip installs python 2.6 when 2.7 is already insta

Wed Dec 31, 2014 5:26 pm

You need to install pip on it's own, not from the raspbian repository (i.e. not using apt-get). To do this:

Code: Select all

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
$ sudo pip install virtualenv

texpilot
Posts: 2
Joined: Wed Dec 31, 2014 2:58 pm

Re: python-pip installs python 2.6 when 2.7 is already insta

Wed Dec 31, 2014 9:14 pm

Ah, roger that Croston. I'm new to the Raspbian/Debian/Ubuntu and python, so whenever I see a tutorial using apt-get, I figured that's "the" way to get it done. Thanks for showing me the "manual" way to install these packages.

Many thanks, greatly appreciated, now I can get rolling on my web interface. Happy New Year!

Return to “Raspberry Pi OS”