Mac Python SDK Setup
This tutorial will guide you step-by-step, from installing the Python development environment, the SDK and its dependencies, to launching your first Highrise bot on a Mac.
We encourage you to follow along with the video tutorial to ensure a successful setup. Your journey into Highrise bot development starts here.
Step 1: Installing Homebrew
Homebrew is a package manager for MacOS that we use to install Python and other tools.
- Go to the Homebrew website at brew.sh in a web browser.
- On the Homebrew homepage, you'll see an install command. Copy this command.
- Open your Mac terminal and paste the install command there.
- Press Enter to start the installation. The process may take about 5 to 10 minutes.
Step 2: Installing Python 3.11
With Homebrew installed, we can now install Python.
- In the terminal, enter the command
brew install [email protected].
- Press Enter to start the Python installation.
Step 3: Installing the Highrise Python SDK
Before installing the SDK, navigate to the directory where you plan to build your bot.
- In your chosen directory, we need to set up a Python virtual environment. This helps manage Python dependencies for your project. Enter the command
python3.11 -m venv .venvin the terminal.
- Now, we activate the virtual environment with the command
- We're ready to install the Highrise Python SDK. Enter the command
pip install highrise-bot-sdk==23.1.0b10. Replace
23.1.0b10with the latest version number of the SDK. The latest version can be found on the Highrise Create Portal.
Step 4: Writing Your Bot Code
Now we can start writing our bot's code.
- In your chosen directory, created a python file called
- Open this file and write your bot code in it. An example bot called Echo is available on the Highrise documentation, which simply prints activities happening in a Highrise room into the terminal.
- Save your code in the Python file.
Step 5: Running Your Bot
Finally, we are ready to run our bot.
- You'll need your Highrise API token and the Room ID where you want to deploy your bot. You can obtain the API token from the Highrise Create Portal, under Dashboard and Credentials, and the Room ID from the Highrise app. In the app, navigate to the room you're interested in and click on "Share this room". A url will be generated that includes your Room ID.
- In the terminal, make sure you're in the directory where your bot's Python file is. Enter the command
highrise <filename>:<class_name> <room_id> <api_token>. Replace
<class_name>with the bot’s file name and the name of the class that implements the Highrise Basebot (most likely
Bot), along as
<api_token>with your actual Room ID and API token respectively.
- Press Enter to run the bot.
With this setup, your bot should now be up and running, echoing what it sees happening in the Highrise room in the terminal.