Problem
When running inside WSL2, PET discovers conda environments from a Windows-side Anaconda installation mounted at /mnt/d/Tools/Anaconda/. It correctly identifies conda_dir = "/mnt/d/Tools/Anaconda" from conda environment metadata, but then fails to locate a conda executable because:
- On Unix,
get_conda_executable() only looks for bin/conda
- Windows Anaconda installs place the executable at
Scripts/conda.exe (or condabin/conda.bat)
- The Windows executable at
/mnt/d/Tools/Anaconda/Scripts/conda.exe is a Windows PE binary and not directly usable from WSL
This produces many error log lines like:
ERROR pet_conda: Unable to find Conda Manager for Conda env (even though we have a conda_dir "/mnt/d/Tools/Anaconda"): Env Details = CondaEnvironment { prefix: "/mnt/d/Tools/Anaconda/envs/deepseek", executable: None, version: None, conda_dir: Some("/mnt/d/Tools/Anaconda"), arch: None }
These errors repeat for every environment under the Windows conda installation, spamming the logs and slowing down Conda locator performance (6+ seconds, dominating the total refresh time).
How environments are discovered
The user likely has entries from the Windows-side Anaconda in ~/.conda/environments.txt or .condarc (which can be shared between Windows and WSL). PET then resolves each environment's conda_dir from conda-meta/history or the parent directory structure, finds /mnt/d/Tools/Anaconda, but cannot locate a usable conda binary there.
User setup
Relevant code
- Error is emitted at
crates/pet-conda/src/lib.rs line ~302 in Locator::find()
- Manager lookup at
crates/pet-conda/src/manager.rs — get_conda_executable() only checks bin/conda on Unix
- Environment discovery via
crates/pet-conda/src/environment_locations.rs
Suggested fix options
-
Skip /mnt/ paths on WSL — Detect that a conda_dir under /mnt/ refers to a Windows filesystem and skip manager lookup (these environments are not usable from WSL anyway since the Python binaries are Windows PE executables).
-
Downgrade to warning — Change the error to a warning or verbose log to reduce log spam, since this is an expected scenario in WSL environments.
-
Detect and filter cross-OS environments early — In environment_locations.rs, when parsing environments.txt or .condarc on WSL, skip entries under /mnt/ mount points since they contain Windows binaries that cannot be executed from Linux.
Option 3 would also avoid the ~6 second Conda locator overhead from trying to resolve environments that can never work.
Logs
Full PET error logs
[pet] ERROR pet_conda: Unable to find Conda Manager for Conda env (even though we have a conda_dir "/mnt/d/Tools/Anaconda"): Env Details = CondaEnvironment { prefix: "/mnt/d/Tools/Anaconda/envs/deepseek", executable: None, version: None, conda_dir: Some("/mnt/d/Tools/Anaconda"), arch: None }
[pet] ERROR pet_conda: Unable to find Conda Manager for Conda env (even though we have a conda_dir "/mnt/d/Tools/Anaconda"): Env Details = CondaEnvironment { prefix: "/mnt/d/Tools/Anaconda", executable: None, version: None, conda_dir: Some("/mnt/d/Tools/Anaconda"), arch: None }
[pet] ERROR pet_conda: Unable to find Conda Manager for Conda env (even though we have a conda_dir "/mnt/d/Tools/Anaconda"): Env Details = CondaEnvironment { prefix: "/mnt/d/Tools/Anaconda/envs/emotion2", executable: None, version: None, conda_dir: Some("/mnt/d/Tools/Anaconda"), arch: None }
... (repeated for every environment under /mnt/d/Tools/Anaconda/envs/)
Problem
When running inside WSL2, PET discovers conda environments from a Windows-side Anaconda installation mounted at
/mnt/d/Tools/Anaconda/. It correctly identifiesconda_dir = "/mnt/d/Tools/Anaconda"from conda environment metadata, but then fails to locate a conda executable because:get_conda_executable()only looks forbin/condaScripts/conda.exe(orcondabin/conda.bat)/mnt/d/Tools/Anaconda/Scripts/conda.exeis a Windows PE binary and not directly usable from WSLThis produces many error log lines like:
These errors repeat for every environment under the Windows conda installation, spamming the logs and slowing down Conda locator performance (6+ seconds, dominating the total refresh time).
How environments are discovered
The user likely has entries from the Windows-side Anaconda in
~/.conda/environments.txtor.condarc(which can be shared between Windows and WSL). PET then resolves each environment'sconda_dirfromconda-meta/historyor the parent directory structure, finds/mnt/d/Tools/Anaconda, but cannot locate a usable conda binary there.User setup
/home/user/miniforge3/bin/conda— works correctlyD:\Tools\Anaconda(mounted as/mnt/d/Tools/Anacondain WSL)Relevant code
crates/pet-conda/src/lib.rsline ~302 inLocator::find()crates/pet-conda/src/manager.rs—get_conda_executable()only checksbin/condaon Unixcrates/pet-conda/src/environment_locations.rsSuggested fix options
Skip
/mnt/paths on WSL — Detect that aconda_dirunder/mnt/refers to a Windows filesystem and skip manager lookup (these environments are not usable from WSL anyway since the Python binaries are Windows PE executables).Downgrade to warning — Change the error to a warning or verbose log to reduce log spam, since this is an expected scenario in WSL environments.
Detect and filter cross-OS environments early — In
environment_locations.rs, when parsingenvironments.txtor.condarcon WSL, skip entries under/mnt/mount points since they contain Windows binaries that cannot be executed from Linux.Option 3 would also avoid the ~6 second Conda locator overhead from trying to resolve environments that can never work.
Logs
Full PET error logs