Python Environment Setup Guide

If your Python environment is already set up, all you need to do is install the pycarta package in your environment by running:

pip install pycarta

If you need to configure your Python environment, please follow the steps below for both Windows and macOS users:

Install Visual Studio Code (VSCode)

  1. Download VSCode:

    • Visit the official Visual Studio Code website: https://code.visualstudio.com/

    • Download the installer appropriate for your operating system (Windows or macOS).

  2. Install VSCode:

    • Run the downloaded installer and follow the on-screen instructions to complete the installation.

Install Python

  1. Download Python:

  2. Install Python:

    • Windows Users:

      • Run the installer.

      • Ensure you check the box labeled “Add Python to PATH.”

      • Proceed with the installation using the default settings.

    • macOS Users:

      • Run the installer and follow the default prompts to complete the installation.

  3. Verify Installation:

    • Open a terminal or command prompt.

    • Type python --version and press Enter.

    • You should see the installed Python version displayed.

Configure VSCode for Python Development

  1. Install the Python Extension:

    • Open VSCode.

    • Click on the Extensions icon in the sidebar or press Ctrl+Shift+X (Cmd+Shift+X on macOS).

    • Search for “Python” and select the extension published by Microsoft.

    • Click the “Install” button to add the extension to VSCode.

  2. Set Up a Virtual Environment:

    • Create a New Project Directory:

      • Open VSCode.

      • Navigate to File > Open Folder... and select or create a folder for your project.

    • Create a Virtual Environment:

      • Open the integrated terminal in VSCode by selecting Terminal > New Terminal.

      • Run the following command to create a virtual environment named .venv:

      python -m venv .venv
      
    • Activate the Virtual Environment:

      • Windows Users:

        .venv\Scripts\activate
        
      • macOS Users:

        source .venv/bin/activate
        
    • Select the Interpreter in VSCode:

      • Press Ctrl+Shift+P (Cmd+Shift+P on macOS) to open the Command Palette.

      • Type Python: Select Interpreter and press Enter.

      • Choose the interpreter located in your virtual environment (e.g., .venv/bin/python or .venv\Scripts\python.exe).

  3. Install pycarta Using pip:

    • With the virtual environment activated, install the pycarta package by running:

    pip install pycarta
    

Set Up Jupyter Notebook in VSCode

  1. Install Jupyter:

    • In the activated virtual environment, install Jupyter by running:

    pip install jupyter
    
  2. Install the Jupyter Extension in VSCode:

    • In VSCode, click on the Extensions icon.

    • Search for “Jupyter” and install the extension published by Microsoft.

  3. Create and Open a Jupyter Notebook:

    • In VSCode, navigate to File > New File....

    • Save the new file with a .ipynb extension (e.g., notebook.ipynb).

    • VSCode will recognize the file as a Jupyter Notebook and open it accordingly.

By following these steps, you will have a fully configured Python development environment in Visual Studio Code, complete with a virtual environment, the pycarta package, and Jupyter Notebook support.