Created
September 24, 2023 06:08
-
-
Save 5shekel/e85de3964900b3d6a3b00a49f64717bc to your computer and use it in GitHub Desktop.
sample script you can use in PowerShell to iterate over all Conda environments and check if Jupyter and PyTorch are installed:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$condaenvs = (conda env list | Out-String) -split "`n" | |
foreach ($condaenv in $condaenvs) { | |
$name = $condaenv.Split(' ')[0] | |
if ($name -ne "" -and $name -ne "#") { | |
Write-Output "================================================================" | |
Write-Output "Environment: $name" | |
Write-Output "`nChecking for Jupyter:" | |
& cmd /c "call activate $name && jupyter --version" | |
Write-Output "`nChecking for Pytorch:" | |
& cmd /c "call activate $name && python -c `"import torch; print(torch.__version__)`"" | |
Write-Output "================================================================" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment