Centos6 install python3 pip3 ipython3

Visit the official website to see what installation packages are available in the python 3.6.x series###

Because it is Centos6, the previous installation of 3.7.x series has some problems in SSL, so consider using 3.6.x series.

Visit the official website to download the address: https://www.python.org/downloads/source/

Install system dependencies###

[ root@centos6 Python-3.6.8]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel -y

Download the installation package of python3.6.x###

[ root@centos6 opt]# wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz

Installation process###

[ root@centos6 opt]# tar -zxvf Python-3.6.8.tgz 
[ root@centos6 Python-3.6.8]# ./configure --prefix=/usr/local/python3
[ root@centos6 Python-3.6.8]# make && make install

Setting up the environment###

After the installation is complete, the file will be in the /usr/local/python3/bin/ path.

[ root@centos6 Python-3.6.8]# ls /usr/local/python3/bin/
2 to3      easy_install-3.6  idle3.6  pip3.6  pydoc3.6  python3.6         python3.6m         python3-config  pyvenv-3.6
2 to3-3.6  idle3             pip3     pydoc3  python3   python3.6-config  python3.6m-config  pyvenv
[ root@centos6 Python-3.6.8]# 
[ root@centos6 bin]# ./python3.6
Python 3.6.8(default, Apr 232019,14:53:03)[GCC 4.4.720120313(Red Hat 4.4.7-23)] on linux
Type "help","copyright","credits" or "license"for more information.>>>exit()[root@centos6 bin]# 
[ root@centos6 bin]# ./pip3 search redis
redis(3.2.1)- Python client for Redis key-value store
redis-completion(0.5.0)- autocomplete with redis

Set up soft connection
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3.6``ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

After setting, it can be used globally, as follows:

[ root@centos6 bin]# ln -s /usr/local/python3/bin/python3.6/usr/bin/python3.6[root@centos6 bin]# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
[ root@centos6 bin]# 
[ root@centos6 bin]# cd ~[root@centos6 ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  gitbook  install.log  install.log.syslog  Music  netperf-2.6.0-2.gf.el6.x86_64.rpm  Pictures  Public  Templates  tmp  Videos
[ root@centos6 ~]# python3.6
Python 3.6.8(default, Apr 232019,14:53:03)[GCC 4.4.720120313(Red Hat 4.4.7-23)] on linux
Type "help","copyright","credits" or "license"for more information.>>> exit
Use exit() or Ctrl-D(i.e. EOF) to exit
>>> exit()[root@centos6 ~]# pip3 search redis
redis(3.2.1)- Python client for Redis key-value store
redis-completion(0.5.0)- autocomplete with redis
kinto-redis(2.0.0)- Kinto Redis

Upgrade pip3 to the latest version###

pip3 install --upgrade pip

[ root@centos6 ~]# pip3 install --upgrade pip
Collecting pip
 Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl(1.4MB)100%|████████████████████████████████|1.4MB 122kB/s 
Installing collected packages: pip
 Found existing installation: pip 18.1
 Uninstalling pip-18.1:
  Successfully uninstalled pip-18.1
Successfully installed pip-19.0.3[root@centos6 ~]# 

Install ipython3

pip3 install ipython

After installation, you can find the binary executable file of ipython from the /usr/local/python3/bin directory.

[ root@centos6 ~]# cd /usr/local/python3/bin
[ root@centos6 bin]# ls
2 to3      easy_install-3.6  idle3.6  iptest3  ipython3  pip3    pydoc3    pygmentize  python3.6         python3.6m         python3-config  pyvenv-3.6
2 to3-3.6  idle3             iptest   ipython  pip       pip3.6  pydoc3.6  python3     python3.6-config  python3.6m-config  pyvenv
[ root@centos6 bin]# ./ipython
/usr/local/python3/lib/python3.6/site-packages/IPython/core/history.py:226: UserWarning: IPython History requires SQLite, your history will not be saved
 warn("IPython History requires SQLite, your history will not be saved")
Python 3.6.8(default, Apr 232019,14:53:03) 
Type 'copyright','credits' or 'license'for more information
IPython 7.4.0-- An enhanced Interactive Python. Type '?'for help.

In [1]:

Configure the soft link of ipython3###

ln -s /usr/local/python3/bin/ipython /usr/bin/ipython3

[ root@centos6 bin]# ln -s /usr/local/python3/bin/ipython /usr/bin/ipython3
[ root@centos6 bin]# 
[ root@centos6 bin]# cd ~[root@centos6 ~]# 
[ root@centos6 ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  gitbook  install.log  install.log.syslog  Music  netperf-2.6.0-2.gf.el6.x86_64.rpm  Pictures  Public  Templates  tmp  Videos
[ root@centos6 ~]# 
[ root@centos6 ~]# ipython3
/usr/local/python3/lib/python3.6/site-packages/IPython/core/history.py:226: UserWarning: IPython History requires SQLite, your history will not be saved
 warn("IPython History requires SQLite, your history will not be saved")
Python 3.6.8(default, Apr 232019,14:53:03) 
Type 'copyright','credits' or 'license'for more information
IPython 7.4.0-- An enhanced Interactive Python. Type '?'for help.

In [1]:

Centos6 compatibility with python3###

After Centos6's installation comparison between python 3.7.x and python 3.6.x, python 3.6.x has the best compatibility.

Recommended Posts

Centos6 install python3 pip3 ipython3
centos7 install python3 and ipython
CentOS7 install python3 and pip3
Centos6 install Python2.7.13
Centos7 install Python 3.6.
CentOS install Python 3.6
Centos7 install Python2.7
Centos install Python3
CentOS6.8 install python2.7
Centos7 uses yum to install pip, ipython
CentOS 6.9 compile and install python
CentOS 6 compile and install python 3
1.5 Install Centos7
Centos 7.5 python3.6
How to install Python 3.8 on CentOS 8
How to install Python on CentOS 8
Install Python3 and ansible under CentOS8
Install Python3 and Py under CentOS7
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
CentOS7 install MySQL
ubuntu18.04 install python2
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS7 upgrade python3
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
ubuntu12.04 install python3
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Python - centos6 installation
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
R&D: How To Install Python 3 on CentOS 7
CentOS6 install mist.io
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS6.5 install CDH5.13
Centos7 install docker18
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8