Learn one python journey Python's basic operating environment

Source: Internet
Author: User

Environment variable Configuration

Programs and executables can be in many directories, and these paths are probably not in the search path where the operating system provides executable files. The path is stored in an environment variable, which is a named string maintained by the operating system. These variables contain information about the available command-line interpreters and other programs. paths in UNIX or Windows path variable path (Unix case-sensitive, Windows is case-insensitive). in Mac OS, the setup process changes the Python installation path. If you need to reference Python in another directory, you must add a Python directory to the path.

Setting environment variables in Unix/linux
    • in CSH Shell: input


    • Setenv PATH "$PATH:/usr/local/bin/python"
    • Press "Enter".



  • in Bash Shell (Linux): input

    Export path= "$PATH:/usr/local/bin/python"
  • Press "Enter".



  • in sh or ksh shell: input

    Path= "$PATH:/usr/local/bin/python"

  • Press "Enter".


Note: /usr/local/bin/python is the installation directory for Python.



Setting environment variables in Windows

To add a Python directory to an environment variable:

    • in the Command Prompt box (cmd): Enter

      Path%path%;D: \python27

      , press "Enter".

Note: D: \python27 is the installation directory for Python2.7.


Learn one python journey Python's basic operating environment

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.