https://www.liquidweb.com/kb/how-to-install-python-3-on-centos-7/
Next, we need to grab the version of Python we want. The following command will pull down the latest stable version of Python 3.8 as of the writing of this article.
[root@centos7 ~]# curl -O https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgzNow we need to extract the file.
[root@centos7 ~]# tar -xzf Python-3.8.1.tgzStep 3: Install Python 3
Now that it’s extracted, let’s change into the resultant directory.
[root@centos7 ~]# cd Python-3.8.1/Next, we need to prepare to compile Python from source.
[root@centos7 Python-3.8.1]# ./configure --enable-optimizationsFinally, we are going to use the following command to finish off the installation, without replacing the default system Python on our system.
[root@centos7 Python-3.8.1]# make altinstallCompiling code from source takes a little while, but once that’s finished, we can test out our new Python 3 version by running the following command.
[root@centos7 Python-3.8.1]# python3.8Much like before when we installed Python 3.6 via Yum, we are dropped into a Python shell that outputs the version we are currently using.
Python 3.8.1 (default, Dec 27 2019, 17:12:30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
没有评论:
发表评论