CENTOS7 installing Python3.6.5 and installing Ipython 6.1.0

Source: Internet
Author: User
Tags openssl

First, CENTOS7 installation Python3.6.5 tutorial

1, before the installation of Python, you need to install some of the following dependencies (if there is a dependency problem, follow the prompts to install):

yum-y Install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel DB4 -devel Libpcap-devel Xz-devel

Yum install xz gcc zlib zlib-devel wget sqlite-devel openssl-devel-y


2. Download Python source package from official website

:https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz

When the download is complete, upload the source package to the server

3. Unzip the file:

Xz-d PYTHON-3.6.5.TAR.XZ

TAR-XVF PYTHON-3.6.5.TAR.XZ

Note: Extract the Python file into the/usr/folder.

4. Enter the file directory

CD Python-3.6.5

5. Start the installation and compilation of Python

./configure--prefix=/usr/python-3.6.5



Execute make command (wait for compilation, about five or six minutes)


Execute the Make install command (wait for the compilation to install)

          

An error occurred during installation and the Zlib package needs to be installed

Yum-y Install zlib*

After installing zlib*, recompile

Make install

6, let the CENTOS7 system can be used by default Python3.6

cd/usr/bin/

MV Python Python.bak #备份原文件

Ln-s/usr/python-3.6.5/bin/python3.6/usr/bin/python (Note your file first letter case)

(Note: ln-s source file destination file to do soft link)

7. Test whether the Python3.6.5 is installed successfully



8. Since the Python2 used by the Yum source is replaced with Python3, it will not work properly. The following information needs to be modified:

To modify a Yum configuration file:

Vi/usr/bin/yum

Change the file's head #!/usr/bin/python to #!/usr/bin/python2.7.


9. Test Yum when normal:

Yum-y Install Vim

Prompt for errors, you need to modify the following information:

Vi/usr/libexec/urlgrabber-ext-down


Change/usr/bin/python to/usr/bin/python2.7

10. Test again if Yum is normal

Yum-y Install Vim


The above steps are the actual operating documentation for CENTOS7 installation of Python3.6.5.


Second, CENTOS7 installation Ipython 6.1.0

1. Installation Dependent environment

Yum install xz gcc zlib zlib-devel wget sqlite-devel openssl-devel-y

2. Download Ipython installation package

Installation package:

wget https://pypi.python.org/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ ipython-6.1.0.tar.gz#md5=1e15e1ce3f3f722da6935d7ac0e51346

Tip Do not install the wget tool, use Yum to install the wget tool

Yum-y Install wget

Continue to download the Ipython installation package

2, Installation Ipython

Tar XF ipython-6.1.0.tar.gz

CD ipython-6.1.0

Install Ipython using python (if Python is already installed)

Python setup.py Install

3. Test whether the Ipython is installed successfully

This error indicates that the environment variable is set incorrectly and is modified in the following way:

alias ipython= ' python-m IPython '

4, prompt the above error, you need to install all missing modules through Pip until the Ipython run successfully:

Hint missing ' traitlets ' module, installing the module via PIP

PIP3 Install Traitlets


5. Download and install Pip

Install extension Source: Yum-y Install Epel-release


Installing the PYTHON-PIP module: Yum Install Python-pip

Ln-sv/usr/python-3.6.5/bin/pip3/usr/bin/pip3


6. Installing the Traitlets module

Pip Install Traitlets


7. PIP3 Install Pygments

8. PIP3 Install Pexpect

9. PIP3 Install Pickleshare

Ten. PIP3 Install Prompt_toolkit

PIP3 Install Simplegeneric

12. Test Ipython again:


Summarize:


In the PIP installation process wasted a lot of time, has been prompted-bash:pip3:command not found from the Internet to find a lot of methods, do not work, and finally create a soft link finally successful.


Through this installation know: In the process of installation, encountered any problem to search more, will be able to find a solution.






CENTOS7 installing Python3.6.5 and installing Ipython 6.1.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.