When Cursor composer agent (in a python project) is doing something in the current project, it should be using the current venv - it runs things like pip install
without activating the current venv, which causes it to modify a global environment.
Are you telling it to use a specific venv?
It works for me. I recently asked it to create a conda environment and use that for the project and it generated and executed commands like this:
source ~/.bash_profile && conda activate torch && pip install torch torchvision torchaudio pytorch-lightning tensorboard albumentations