Skip to content

Instantly share code, notes, and snippets.

@twobob
Created March 6, 2025 18:11
Show Gist options
  • Save twobob/7b11ef9b87e1ad2f30b43a6e2c2a46d2 to your computer and use it in GitHub Desktop.
Save twobob/7b11ef9b87e1ad2f30b43a6e2c2a46d2 to your computer and use it in GitHub Desktop.
"import cv2, mediapipe" tester for conda envs
conda env list --json | python -c "import json,sys,subprocess as sp; from pathlib import Path; envs=json.load(sys.stdin)['envs']; [print(e, 'HAS cv2+mediapipe' if sp.run([str(Path(e, 'python.exe')), '-c', 'import cv2, mediapipe'], stdout=sp.DEVNULL, stderr=sp.DEVNULL).returncode==0 else 'DOES NOT') for e in envs]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment