> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# ZED Python API within a Virtual Environment

This section explains how to set up the ZED Python wrapper in a virtual environment.

The whole setup is based on [Anaconda](https://www.anaconda.com/products/individual), it handles virtual environments, packages and IDE.

![image](/_fern-img/f6a02832116037ee5b43e02df75b538111fa68744e963b88825279e7e0895a10.webp)

## Create a new environment

To create a new environment that enables you to use the ZED Python wrapper, select the `Environments` tab on the left panel and then click `Create` at the bottom of the page.

![image](/_fern-img/52a949b51f9c3ab38ade4a72a6fabf6392060f1f1d0fb08a771d634c4f9175ef.webp)

A dialog box appears. Give a name to your new environment and click `Create`.

![image](/_fern-files/stereolabs.docs.buildwithfern.com/36841cd67fd14a2164328d77040b9766aea5dc61a399b352574113a32d51be59/docs/development/images/py_env/new.png)

Your newly created environment is now listed below the `base (root)` one.

![image](/_fern-img/1154aef54fa168516bca1536fc7bc245006b46424c917b5057e8d9047f418e0a.webp)

## Add the ZED package

At this point, [these instructions](/docs/development/api-languages/python) will be adapted to our needs, the main difference is that we want to install it on our virtual environment and not directly on the computer.

To do so, click on its name and then on the triangle icon to select `Open Terminal`.

![image](/_fern-img/cc855c163286a185fd45750ec27829148343030284c6d1ff68e800e03ad94253.webp)

As said for the ZED package installation, copy the file `get_python_api.py` somewhere you can execute it without permission issues and then run it.

![image](/_fern-files/stereolabs.docs.buildwithfern.com/8e7c9eaf348eb395af84f7822f70f864290a028f5dfa6a634c73428a977e9c1b/docs/development/images/py_env/console.png)

The ZED package is now installed, and you can close the Terminal.
To make sure it is set up correctly, click on `Update index..`; the ZED package named `pyzed` should appear in your environment.

![image](/_fern-img/1327316bd75511e2b1f3b6a79090349ee532530c0a2ec5ea1070cfa41ed5a1f9.webp)

As samples are using OpenGL for display, updated OpenGL packages are also installed for Windows.

## Use the ZED environment

Be sure you have the [ZED examples](https://github.com/stereolabs/zed-sdk) on your computer or download them.

Go back to the `Home` tab on the left panel and select your environment.

![image](/_fern-img/95cd8b04f28247ec22fc764c71b51c5bb33bf4dcb8f8800361c0d12bb3ae5f74.webp)

Choose your preferred IDE, open a Python sample, and make sure you are really in your virtual environment. That's all, you can run the sample!

![image](/_fern-img/18439717f984e84479b5c3f746e9ca9e353ba3eda03ed7fdecbe142420dd6b2c.webp)