Configuration of Python installation and environment variables in Windows and Linux environments

Source: Internet
Author: User

Windows

    1. Version selection

      This learning process is used for the preparation of server-side automation scripts, using version 2.7, and optionally 3.6 versions if required

    2. https://www.python.org/downloads/windows/

    3. Install the installation package

      Control Panel \ All Control Panel items \ System

      Select Advanced System Settings

      Select environment variable settings in the Advanced tab page

      Add the path to the Python installation in path

    4. Check the installation

      Enter Python in Cmd to see if the installation was successful



Linux

    1. Version selection

      This learning process is used for the preparation of server-side automation scripts, using version 2.7, and optionally 3.6 versions if required

    2. https://www.python.org/downloads/source/

    3. Install the installation package

      Installation without dual version presence

      1) Download the source package

      2) Unzip the source package and enter the folder

      ./configure; Make && make install

      3) Use Python-v to see if the installation is successful and the installation will display Python version information

      Requires dual version to install Python version

      1) ditto, need to download 3.6 source Package

      2) Unzip the source package and enter the folder

      You need to manually create a Python directory before installing mkdir/usr/local/python3.6

      Installation directories need to be manually specified at install time

      ./configure--prefix=/usr/local/python3.6

      Make && make install

      3) post-installation configuration

      Back up the original Python launcher mv/usr/bin/python/usr/bin/python_old

      Soft-connect the newly installed Python version to the original startup program Ln-s/usr/local/python3.6/bin/python3.6/usr/bin/python

      4) Modify the Python path in the Yum source

      Vi/usr/bin/yum

    4. #!/usr/bin/python modified to:/usr/bin/python_old

    5. Installation Check

      Python-v viewing the Python installation version



Simply write a python program that outputs Hello World

# python

>>> print "Hello World"

Hello World

>>> print ' Hello World '

Hello World


This article is from the "Coarse bread" blog, make sure to keep this source http://culiangmianbao.blog.51cto.com/10475024/1972948

Configuration of Python installation and environment variables in Windows and Linux environments

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.