Initial settings for using Python3.8 and pip on CentOS8

yum and dnf

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.

Install Python 3.8

$ sudo dnf install python38 -y


As you can see from the command again, it's not much different from the yum command.

Check Python 3.8 version

//Either way
$ python3.8 --version 
Python 3.8.0
$ python3.8 -V
Python 3.8.0


Check pip version

//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)


To run Python 3.8 in Python

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

To run pip3.8 with pip

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


important point

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

Initial settings for using Python3.8 and pip on CentOS8
Notes on installing Python3 and using pip on Windows7
Initial settings for using GrovePi + starter kit and camera on Raspberry Pi
Install Python on CentOS using Pyenv
Install Python on CentOS using pyenv
Python and pip commands are not available on CentOS (RHEL) 8
Notes for using OpenCV on Windows10 Python 3.8.3.
A memo with Python2.7 and Python3 on CentOS
Settings when using Python 3 requests and Beautiful Soup with crostini on Chromebook
Put MeCab binding for Python with pip on Windows, mac and Linux
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
[Python / Chrome] Basic settings and operations for scraping
Install Python and libraries for Python on MacOS Catalina
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
Searching for pixiv tags and saving illustrations using Python
Extendable skeletons for Vim using Python, Click and Jinja2
Initial settings when using the foursquare API in python
[Heroku] Memo for deploying Python apps using Heroku on Windows [Python]
Compile and install MySQL-python for python2.7 on amazon linux
Settings for testing C ++ 11 Python modules on Travis CI
Install PyCall on Raspberry PI and try using GPIO's library for Python from Ruby
Python on Ruby and angry Ruby on Python
Anaconda 4.4.0 Initial Settings for Windows
Install Python 3.8 on CentOS 7 (SCL)
Install Python 3.7 and Django 3.0 (CentOS)
Install Python 3.8 on CentOS 8 (AppStream)
Broadcast on LINE using python
Notes on installing Python on CentOS
Build an environment for machine learning using Python on MacOSX
Building a Python environment on a Mac and using Jupyter lab
Access google spreadsheet using python on raspberry pi (for myself)
Install python3 and scientific calculation library on Ubuntu (virtualenv + pip)
IP spoof using tor on macOS and check with python
[Python] Accessing and cropping image pixels using OpenCV (for beginners)
Build a python environment on CentOS 7.7 for your home server
This and that for using Step Functions with CDK + Python
The first artificial intelligence. Tensorflow on CentOS7.0. Built separately for python3.5 series and python2.7 series with virtualenv.
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.
Snippet settings for python jupyter notebook
Authentication using tweepy-User authentication and application authentication (Python)
Build a game leaderboard on Alibaba cloud using Python and Redis
Introducing Python using pyenv on Ubuntu 20.04
Notes on using MeCab from Python
Preparing python using vscode on ubuntu
Ansible playbook for setting up Python preferences using pyenv on Mac
Install Python on Windows + pip + virtualenv
Network settings and confirmation in CentOS7
Notes on using post-receive and post-merge
Integrate Modelica and Python on Windows
Study on Tokyo Rent Using Python (3-2)
Set up Python environment on CentOS
Notes on installing Python using PyEnv
[TouchDesigner] Tips for for statements using python
Install pip on CentOS7. Also iPython.
Create a python environment on centos
Clustering and visualization using Python and CytoScape