keywords: Python, Install pip in Python 3

slogan_image

Install Python 3.11
sudo dnf install python3.11 -y

Install pip for python 3.11

sudo dnf install python3.11-pip -y
Multiple Python version

Installing Python 3

The default Python implementation is usually installed by default. To install it manually, use the following procedure.

Procedure

To install Python 3.9, use:

sudo dnf install python3

To install Python 3.11, use:

sudo dnf install python3.11

To install Python 3.12, use:

sudo dnf install python3.12

Verification

To verify the Python version installed on your system, use the –version option with the python command specific for your required version of Python. For Python 3.9:

$ python3 --version

For Python 3.11:

$ python3.11 --version

For Python 3.12:

$ python3.12 --version

origin: Installing and using Python

Install Pip

Check if pip was available:

pip --version

If pip isn’t already installed, then first try to bootstrap it from the standard library:

python -m ensurepip --default-pip

Or install pip independently:

python -m pip install --upgrade pip setuptools wheel

Then add directory Scripts in environment variables of OS, e.g. D:\Python\Python38-32\Scripts.

Reference:
https://packaging.python.org/tutorials/installing-packages/#id14

Install numpy
pip install numpy

Issues

ModuleNotFoundError: No module named ‘pip’

Error on executing pip:

Traceback (most recent call last):
  File "d:\sdks\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "d:\sdks\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\SDKs\Python\Python38-32\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

Solution:
Run:

python -m ensurepip

Or:

py -m ensurepip

he best way to predict your future is to create it. ― Peter Drucker