1

We have installed python 3.9 from external Link, my OS has in built python 3.6 and python3-pip for 3.6 version. If I install pip packages it will install for python 3.6 and it is not compatible for python 3.9. How to install pip3.9 ? so that i will install packages from pip3.9 command.

OS: Cent OS

I tried like this

 python3.9 -m pip
 python3.9: No module named pip
4
  • 1
    Usually pip would be installed along with the rest of the standard library for any recent Python version. Are you able to access other modules from 3.9? Did you disable pip installation when you built it? (Or what exactly does "from external link" mean? Somebody else's build?) Commented Nov 8, 2021 at 6:23
  • @tripleee, yes. In my case pip is not installed might be my company not added it. If I install from python from python.org it will come along with it. not sure is there any alternate way to deal wit hit Commented Nov 8, 2021 at 6:32
  • No, that will only install them for 3.6. Commented Nov 8, 2021 at 6:39
  • How about /path/to/python3.9/python -m pip install abc. Another suggestion is to use Conda, which handles different python versions pretty effectively. Commented Nov 8, 2021 at 6:46

2 Answers 2

9

Some Python distributions may not come with pip installed. Try

python3.9 -m ensurepip

to install pip for your interpreter first.

Sign up to request clarification or add additional context in comments.

Comments

-1

Adding on @Selcuk 's answer, you can define which python version runs pip:

For example:

/path/to/python3.9/python -m pip install mypackage

This would install mypackage for the python version you referenced to.

Another suggestion is to use Conda, which handles different python versions pretty effectively.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.