Does linux come with python?

(*-*)浩
Release: 2019-07-10 10:55:31
Original
6255 people have browsed it

There are many needs of the operating system itself, all of which require the use of Python.

Does linux come with python?

For example, Linux software upgrade tools, Red Hat-based yum, and Debain/Ubuntu-based apt-get, are all based on Python. And their versions must remain the same as the original ones. Even if you upgrade the Python version, you must pay attention to the fact that the scripts of the old version can still be used normally. (Recommended learning: Python video tutorial)

It can be said that among the various scripting languages ​​​​of Linux/Unix, in addition to the various shells that come with the system itself, another It is the Python language that is used the most. Some systems such as FreeBSD also come with Ruby.

Linux system comes with python2 upgrade to python3

First of all, let me explain:

Many friends have installed python3 and set up python After the soft connection, it was found that yum could not be used.

Reason: yum depends on python2

Both versions can exist at the same time

#Download the installation package

wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
Copy after login

Upgrade python2 to python3 (the two versions can coexist Coexistence):

Enter python, directly enter the python2 environment

Enter python3, directly enter the python3 environment (because yum depends on python2, so the python2 version cannot be overwritten)

Solution:

Enter the command when establishing a soft connection;

#ln -s /usr/local/python36/bin/python3 /usr/bin/python3
Copy after login

Note: /usr/local/python36/bin/python3 is the installation directory of python3

/usr/bin/python3 指定到这个目录下,指定为python3
Copy after login

#Establish a soft connection to pip

 # ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
Copy after login

Perfect solution! ! !

For more Python related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of Does linux come with python?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template