Currently learning Python3 has become the mainstream, for the installation of Python3, here to do a simple summary, in the installation process there are some small pits, shared out for your reference.
I use the system is: CentOS 7.2.1511, minimized installation method, install Python3.5 version.
Download and install Python3
1. Install the necessary compilation environment and installation tools on the system first:
Yum Install wget gcc gcc+
2, download the official python3.5.3 source package
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
3, unzip the source package, and install
Tar xvf python-3.5.3.tgz cd python-3.5.3./configure makemake install
4, after the installation is complete, the execution python3
command to view the current Python version
[[email protected] ~]# Python3python 3.5.3 (default, APR 4, 16:32:58) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on Lin Uxtype "Help", "copyright", "credits" or "license" for more information.>>>
Resolve Python3 cannot use fallback key
After Python3 is installed, if you want to use the Python3 console interface, you cannot use the fallback and arrow keys to move the cursor by default. When using the arrow keys and fallback keys to control the cursor, the following occurs:
>>> exit () ^h^h^h^h^[[c^[[d
If you only need to use the fallback key, you can first press the CTRL key, and then press the fallback key to delete, but to use the left and RIGHT arrow keys to move the cursor will appear garbled. The reason for this problem is that in the Python shell, these key instructions are not translated into specific operations, and the key function instructions are readline.
To solve this problem we need to install the corresponding ReadLine tool.
Yum Install Readline-devel-y
Then, recompile the installation as you did before:).
This article is from the "Trying" blog, make sure to keep this source http://tryingstuff.blog.51cto.com/4603492/1912879
CentOS Installation Python3