Python and pip commands are not available on CentOS (RHEL) 8

Introduction

If you think that the python and pip commands cannot be used on CenoOS, they are not installed, and even if you install them, they will not use the ones installed by default, so you had to set them.

https://dev.classmethod.jp/articles/in-search-of-lost-python-at-rhel-8/#toc-3

Install python

For the time being, install all python modules

dnf install python36*

Or

yum -y install python36*

If you want to install the pip command, you can install the following packages.

rpm -qf /bin/pip3
python36-3.6.8-2.module_el8.1.0+245+c39af44f.x86_64

rpm -qf /bin/pip3.6
python3-pip-9.0.3-16.el8.noarch

Set to an environment where python commands can be executed alone

Just installing it does not use the installed python as the system default, so execute the following command to select the installed python version. Below, select "2" and press enter.

alternatives --config python

There are 2 programs'python'To provide.

Select command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3

Press Enter to select the current[+]Or enter the selection number:2


python --version
Python 3.6.8

Set to an environment where the pip command can be executed alone

Also here, execute the following command to create an environment where the installed pip3 command can be executed.

update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

pip --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)


Recommended Posts

Python and pip commands are not available on CentOS (RHEL) 8
Initial settings for using Python3.8 and pip on CentOS8
[Python] Make pip available on macOS
A memo with Python2.7 and Python3 on CentOS
Notes on installing Python3 and using pip on Windows7
[Note] Installing Python 3.6 + α on Windows and RHEL
Install ZIP version Python and pip on Windows 10
[Python] pip and wheel
Install Python3.4 on CentOS 6.6
Install Python 2.7.3 on CentOS 5.4
Python default arguments are not initialized on every call
How to install Python2.7 python3.5 with pyenv (on RHEL5 CentOS5) (2016 Nov)
Install Python 3.8 on RHEL 8 (AppStream)
Python on Ruby and angry Ruby on Python
Install Python 3.8 on CentOS 7 (SCL)
Made python available on macOS
Install Python 3.7 and Django 3.0 (CentOS)
Install Python 3.8 on CentOS 8 (AppStream)
Notes on installing Python on CentOS
[Python3] "A // B" and "math.floor (A / B)" are not always the same! ??
[Python] What are @classmethods and decorators?
Eating and comparing programming languages: Python and Ruby
What are you comparing with Python is and ==?
What are python tuples and * args after all?
Ruby, Python and map
Python and Ruby split
Python and pip commands are not available on CentOS (RHEL) 8
[Python3] "A // B" and "math.floor (A / B)" are not always the same! ??
Freetype2 support not available on PIL when trying to blockdiag on CentOS6.5
Build Python environment on Ubuntu (when pip is not the default)
Python a + = b and a = a + b are different
Notes on Python and dictionary types
Python 3.6 on Windows ... and to Xamarin.
Install Python 2.7.9 and Python 3.4.x with pip.
Install Python on Windows + pip + virtualenv
Integrate Modelica and Python on Windows
[Python] What are @classmethods and decorators?
a () and a.__ call__ () are not equivalent
Install pip on CentOS7. Also iPython.
Mastering pip and wheel on windows
Install Python on CentOS using Pyenv
Build a python3 environment on CentOS7
Install Python on CentOS using pyenv
Install easy_install and pip on windows
Introducing a library that was not included in pip on Python / Windows
Modules and packages in Python are "namespaces"
Build Python3 and OpenCV environment on Ubuntu 18.04
Python virtual environment and packages on Ubuntu
Python installation and package management with pip
Virtualenv does not work on Python3.5 (Windows)
Connecting from python to MySQL on CentOS 6.4
scipy stumbles with pip install on python 2.7.8
Notes on building Python and pyenv on Mac
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
See file and folder information on python
Install python on xserver to use pip
Understand python lists, dictionaries, and so on.
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Install pyenv and rbenv on CentOS system-wide
Python open and io.open are the same