How to add pip to Python?

Moderator: Forum moderators

Post Reply
parapup
Posts: 3
Joined: Mon Dec 06, 2021 2:25 am
Has thanked: 1 time

How to add pip to Python?

Post by parapup »

Iv'e had some success running some basic python code on Raspup. I would like to add a module using pip. A search on PPM brings up python-pip_18.1-5 and it appears to be installed, however "python -m pip version" in terminal returns ~ usr//bin/python: No module named pip. Raspup has Python version 2.7.16 so pip needs to be bootstrapped but my attempts are not working. :(

Last edited by Flash on Mon Dec 06, 2021 9:56 pm, edited 1 time in total.
Reason: Original title: Python
User avatar
snoring_cat
Posts: 206
Joined: Tue Sep 21, 2021 3:40 pm
Location: Earth
Has thanked: 24 times
Been thanked: 46 times

Re: How to add pip to Python?

Post by snoring_cat »

Hi parapup,

pip should be able to be run by itself, without having to start it with python. Below is an example of it being used on Puppy Linux Fossa 64

Code: Select all

pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

pip install socks
Collecting socks
  Downloading socks-0.tar.gz (618 bytes)
Building wheels for collected packages: socks
  Building wheel for socks (setup.py) ... done
  Created wheel for socks: filename=socks-0-py3-none-any.whl size=995 sha256=1215fe95ba42239a60b25c930370bce2c5d570d8fbb11876ca8a82c937ded348
  Stored in directory: /root/.cache/pip/wheels/f4/d2/15/1266e76101e7deac862456ded4c0247b676c5f5168e03bab26
Successfully built socks
Installing collected packages: socks
Successfully installed socks-0

Meeeooow!

-- substance over noise, since 5 minutes in the future --

parapup
Posts: 3
Joined: Mon Dec 06, 2021 2:25 am
Has thanked: 1 time

Re: How to add pip to Python?

Post by parapup »

Thanks snoring_cat,

But...
pip --version ->returns
bash: pip: command not found

So I guess pip is not installed. I have to work on that.

User avatar
rockedge
Site Admin
Posts: 6551
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2757 times
Been thanked: 2627 times
Contact:

Re: How to add pip to Python?

Post by rockedge »

Open the PPM again and search for python-pip_18.1-5 and select it again then attempt to install it. Good chance the PPM is saying it's installed when it is not. Remember the pip has to match the python 2.7 version.

See if this helps

parapup
Posts: 3
Joined: Mon Dec 06, 2021 2:25 am
Has thanked: 1 time

Re: How to add pip to Python?

Post by parapup »

rockedge wrote: Wed Dec 08, 2021 3:37 am

Open the PPM again and search for python-pip_18.1-5 and select it again then attempt to install it. Good chance the PPM is saying it's installed when it is not. Remember the pip has to match the python 2.7 version.

See if this helps

Thanks Rockedge!
Success, problem caused by user error/ignorance.

User avatar
mikeslr
Posts: 2965
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 178 times
Been thanked: 922 times

Re: How to add pip to Python?

Post by mikeslr »

Sort of 'off-topic'. But is there a pip-package(?) that can do what ListDD does with respect to binaries, that is produce an out-put file indicating what python packages are 'missing' from one's application constructed using python?

Post Reply

Return to “Raspbian Buster”