Skip to content

Use .venv over base conda environment #611

@Danielkonge

Description

@Danielkonge

Summary

In some cases, one can have a .venv without activating it (e.g. a .venv created by bazel), but it will currently not be found with a standard setup, where conda is installed.

This is because even without activating a conda environment, you will still usually have ~ CONDA_DEFAULT_ENV=base CONDA_PREFIX=/opt/anaconda3, so ty will use site-packages from your base conda environment and not look in the .venv.

I think ty should generally prefer the .venv over the base conda environment here. It is less clear if you would prefer the .venv if any non-standard environment is activated, but at least for the base environment I think that the current behavior is unexpected.

Version

ty 0.0.1-alpha.8 (c1337c9 2025-06-02)

Metadata

Metadata

Assignees

Labels

importsModule resolution, site-packages discovery, import-related diagnostics

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions