From CentOS8, unlike up to 7, the ** yum command is not used. ** ** You can use yum by pushing it, but we don't recommend it. We will use the successor ** dnf command. ** **
Basically, you can use it in almost the same way as the yum command. What's the difference is ...
--The yum command runs on Python 2 series --The dnf command runs on Python 3 series
Is it inevitable to try to work with Python 3 system? If you want to know more details, please follow the link below.
$ sudo dnf install python38 -y
As you can see from the command again, it's not much different from the yum command.
//Either way
$ python3.8 --version
Python 3.8.0
$ python3.8 -V
Python 3.8.0
//Either way
$ pip3.8 --version
pip 19.2.3 from /usr/lib/python3.8/site-packages/pip (python 3.8)
$ pip3.8 -V
pip 19.2.3 from /usr/lib/python3.8/site-packages/pip (python 3.8)
It's a shame that you have to specify the version every time, so we will set it to use 3.8 by default.
$ alternatives --config python
There are 3 programs'python'To provide.
Select command
-----------------------------------------------
*+ 1 /usr/libexec/no-python
2 /usr/bin/python3
3 /usr/bin/python3.8
Press Enter to select the current[+]Or enter the selection number: 3 //Enter the corresponding numerical value according to the environment you want to select
From the programs listed in the command section, select the program you want to use as standard and enter the number. This will run 3.8 python with python only, instead of the command you used to type python3.8
You can't change it with the python3.8-> python procedure and you will have to use a different command
$ sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3.8 1
It happened when I was trying to set pip by myself, so be careful, but be aware that the directory displayed by the following command is not the directory actually specified by update-alternatives.
$ pip3.8 -V
pip 19.2.3 from /usr/lib/python3.8/site-packages/pip (python 3.8)
With the above steps, you can safely handle python and pip. This will make it easier to study Ansible ...
Recommended Posts