Document toolboxDocument toolbox

Installing Python on Your local Machine

Installing on Windows, macOS, Linux, and other operating systems

To install Python on your local machine according to your operating system, refer to the following instructions.

Windows

  1. Download Python:

    • Go to the official Python website page: Python Releases for Windows and download the latest stable release.

    • Click on the "Downloads" tab and select the latest version of Python for Windows.

    • Download the installer (usually a .exe file).

  2. Install Python:

    • Run the downloaded installer.

    • Make sure to check the box that says "Add Python to PATH" before clicking "Install Now".

    • Follow the prompts to complete the installation.

  3. Verify Installation:

    • Open Command Prompt (type cmd in the search bar and press Enter).

    • Type python --version and press Enter. This should display the installed Python version.

    • Type pip --version to check the pip installation.

  4. Install a Virtual Environment:

    • In Command Prompt, navigate to the directory where you want your project.

    • Run python -m venv env to create a virtual environment named env.

    • Activate the virtual environment with .\env\Scripts\activate.

    • You can deactivate it with deactivate.

  5. Install Packages:
    Install any required packages needed for deloping your automation scripts.

macOS

  1. Download Python:

    • Go to the official Python website page: Python Releases for macOS and download the latest stable release.

  2. Install Python:

    • Open the downloaded .pkg file and follow the instructions to install Python.

  3. Verify Installation:

    • Open Terminal (you can find it in Applications > Utilities).

    • Type python3 --version to check the Python installation.

    • Type pip3 --version to check the pip installation.

  4. Install a Virtual Environment:

    • In Terminal, navigate to your project directory.

    • Run python3 -m venv env to create a virtual environment named env.

    • Activate the virtual environment with source env/bin/activate.

    • You can deactivate it with deactivate.

  5. Install Packages:
    Install any required packages needed for deloping your automation scripts.

Linux

  1. Install Python:

    • Most Linux distributions come with Python pre-installed. You can check by typing python3 --version in Terminal.

    • If Python is not installed, you can install it using your package manager. For example, on Debian-based systems (like Ubuntu):

      sudo apt update sudo apt install python3 python3-pip python3-venv
  2. Install Packages:
    Install any required packages needed for deloping your automation scripts.

  3. Install a Virtual Environment:

    • In Terminal, navigate to your project directory.

    • Run python3 -m venv env to create a virtual environment named env.

    • Activate the virtual environment with source env/bin/activate.

    • You can deactivate it with deactivate.

Common Steps (after setting up the environment)

  1. Upgrade pip:

    pip install --upgrade pip
  2. Install a Virtual Environment:

    • Use pip install package_name to install packages.

    • Example: pip install numpy pandas matplotlib.

  3. Freeze Requirements (optional):

    • Create a requirements.txt file to record the dependencies.

    • Run pip freeze > requirements.txt.

  4. Install Requirements (optional):

    • Use pip install -r requirements.txt to install all packages listed in the requirements.txt.

Other Operating Systems

Visit Download Python for Other Platforms to download and install Python for other operating systems.

Â