PandaOSPandaOS
Projects and workspace

Python environments

Make every command Panda runs in a Python project use the right Python and the right packages.

Feature Updated 20 Nov 2026

What a Python environment is

A Python project usually keeps its packages in a virtual environment, made with venv, conda or poetry. If Panda runs python or pip outside it, the command uses the wrong Python or misses packages. PandaOS finds the environment and can switch it on for every chat in the project.

Choose the environment

Open the project overview, press Project settings, and pick the Environment tab. The tab shows only in projects with coding tools on.

  1. Pick one under Virtual environment.
    The list shows None, every environment PandaOS found, such as .venv or conda: myenv, and Custom command....
  2. Or choose Custom command... and type your own.
    Use this for environments in unusual places, your own activation script, Nix shells or direnv. The command goes in Activation command.
  3. Turn on Activate for all sessions.
    The switch stays off until an environment or a command is chosen.

What Activate for all sessions does

When a chat starts, PandaOS runs the activation command once and starts the chat with the environment it produces. Every command Panda runs then sees the right Python and packages, and nothing is added to the commands you read in the chat.

PandaOS also writes a rule, .pandaos/rules/python-env.md, telling Panda the environment is already active. If activation fails, or takes longer than ten seconds, the turn stops instead of running in the wrong environment.

Activation covers a whole chat, not single commands. To run something outside the environment, turn the switch off.

Environments PandaOS finds

TypeDetectionActivation Command
venv (.venv, venv, env)Checks for bin/activate, or Scripts\activate.bat on Windowssource .venv/bin/activate
CondaReads env name from environment.yml or environment.yamleval "$(conda shell.bash hook)" && conda activate <name>
PoetryChecks for poetry.locksource "$(poetry env info -p)/bin/activate"

On Windows, a venv is activated with .venv\Scripts\activate.bat instead.

PandaOS checks for environments in the order of this table. If multiple environments exist, such as a .venv and a conda environment, all are shown in the dropdown. Pick the right one there.

Conda

Conda needs its shell hook before conda activate works outside an interactive shell. PandaOS adds eval "$(conda shell.bash hook)" to the command for you. On Windows it runs plain conda activate <name> without the hook.

When PandaOS looks

PandaOS looks for environments when you add a project and keeps the first one it finds. Press Detect next to the list to look again, for example after you create a new venv.