Setting up a Python project for the Custom Synapse (VS Code)
This article will help you with setting up a Python project within VS Code editor.
Requirements
Before we start we need to make sure to have the following installed on our machine:
- Latest version of Python 3,
- VS Code editor and
- the official Python plugin.
Setup
First we need to create a new project folder and open the integrated terminal, by right clicking on the folder and selecting "Open in Integrated Terminal" option. This will open a new terminal tab inside the VS Code that is pointing to our project folder.
In the terminal we need to execute the following two commands:
- Creating a new Python project:
python3 -m venv .
- Activating a Python Virtual Environment:
source bin/activate
Once we have a virtual environment activated we'll see that our terminal has added our project's name inside brackets of each line.
Before installing the Syncari SDK package we need to make sure that our Python virtual environment is using the project interpreter and not the system one. We can access the command palette by pressing UP + CMD + P (macOS)
or UP + CTRL
+ P (Windows)
, or from menu View
-> Command Palette...
-> Python:Select interpreter
.
Inside the field "Enter path to a Python interpreter" we need to add the following:
./Our_Folder_Name/bin/python
Installing Syncari SDK
Once we have the interpreter configured (and have the virtual environment active) we can run the pip command from the terminal to install the Syncari SDK Python package:
pip install syncari-sdk