Install python3.5.1 and BS4 on CentOS 7

Source: Internet
Author: User
Tags centos

1. The default use of the CENTOS7 is the python2.7 version, do not move it.

2. Download python3.5.1, Address: https://www.python.org/downloads/source/click: gzipped source Tarsal and BS4, address: https:// www.crummy.com/software/BeautifulSoup/bs4/download/4.0/

3. Installation steps:

1 into the/usr/local directory: cd/usr/local

2 Create a new folder in the local directory: sudo mkdir python3

3) Decompression PYTHON-3.5.1.TAR:TAR-XVF Python-3.5.1.tar

4 after the successful decompression, into the extracted folder: CD Python-3.5.1

5 Enter command:./configure--prefix=/usr/local/python3 (here is the folder you just created)

6 sudo make

7 sudo make install

8 Create connection in/usr/bin directory, command: Ln-s/usr/local/python3/bin/python3/usr/bin/

9) test, Input command: Python3, this python3.5.1 installation complete

10 into the Python command interface, input: from BS4 import BeautifulSoup, error.

4. Configure BS4:

1 extract BEAUTIFULSOUP4-4.1:TAR-XVF package name;

2 into the Unpacked folder, installation command: Python3 setup.py install

3 to convert BS to support Python3, command:/usr/local/python3/bin/2to3-3.5-w BS4

4 test: Input python3, enter Python command interface, input: from BS4 import BeautifulSoup

5 end, may prompt other error, but at least no longer prompts no this module

Related Article

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.