xiaowei-system/scripts/legacy-checks/check_python.py

8 lines
509 B
Python

import subprocess
result = subprocess.run(['which', 'python3'], capture_output=True, text=True)
print(f"python3: {result.stdout}")
result = subprocess.run(['python3', '-c', 'import pytesseract; print(pytesseract.__version__)'], capture_output=True, text=True)
print(f"pytesseract: {result.stdout.strip() or result.stderr.strip()}")
result = subprocess.run(['python3', '-c', 'import PIL; print(PIL.__version__)'], capture_output=True, text=True)
print(f"PIL: {result.stdout.strip() or result.stderr.strip()}")