Create and Use Python Environment

What is a Python Environment and Python Virtual Environment?

Python environment refers to the combination of software and settings that enable you to write, run, and manage Python programs. It includes the Python interpreter, libraries, modules, and other tools that are necessary for developing and executing Python code.

Here are the key components of a Python environment:

  1. Python Interpreter
  2. Python Standard Library
  3. Third-Party Libraries
  4. Integrated Development Environment (IDE)
  5. Package Managers (such as PIP)
  6. Virtual Environments
  7. Configuration Files

Virtual environments provide isolated environments for Python projects. They allow you to have different sets of dependencies and versions for different projects. Virtual environments help prevent conflicts between packages and provide a clean, reproducible environment for your projects.

Why use Python Virtual Environments?

It prevents conflicts between packages and provides a clean, reproducible environment for your projects.

How do I create Python Environment in VSCode?

  1. In VSCode (on Mac),  type Cmd+Shift + P, then select “Python Environment”.
  2. Select venv or konda
  3. Select the requirement files (if any),
  4. then select the Python interpreter version.

How to use Python Environment?

You can set up multiple Python Environments on your development machine. Once set up on VS Code, simply open a new terminal and a Python Environment terminal would be opened