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)
Download VSCode:
Visit the official Visual Studio Code website: https://code.visualstudio.com/
Download the installer appropriate for your operating system (Windows or macOS).
Install VSCode:
Run the downloaded installer and follow the on-screen instructions to complete the installation.
Install Python
Download Python:
Navigate to the official Python website: https://www.python.org/downloads/
Download the latest stable release suitable for your operating system.
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.
Verify Installation:
Open a terminal or command prompt.
Type
python --versionand press Enter.You should see the installed Python version displayed.
Configure VSCode for Python Development
Install the Python Extension:
Open VSCode.
Click on the Extensions icon in the sidebar or press
Ctrl+Shift+X(Cmd+Shift+Xon macOS).Search for “Python” and select the extension published by Microsoft.
Click the “Install” button to add the extension to VSCode.
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+Pon macOS) to open the Command Palette.Type
Python: Select Interpreterand press Enter.Choose the interpreter located in your virtual environment (e.g.,
.venv/bin/pythonor.venv\Scripts\python.exe).
Install pycarta Using pip:
With the virtual environment activated, install the pycarta package by running:
pip install pycarta
Set Up Jupyter Notebook in VSCode
Install Jupyter:
In the activated virtual environment, install Jupyter by running:
pip install jupyter
Install the Jupyter Extension in VSCode:
In VSCode, click on the Extensions icon.
Search for “Jupyter” and install the extension published by Microsoft.
Create and Open a Jupyter Notebook:
In VSCode, navigate to
File > New File....Save the new file with a
.ipynbextension (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.