Advertisement
Guest User

pythonversions.py

a guest
Jun 18th, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.80 KB | Software | 0 0
  1. import sys
  2. import torch
  3. import torchvision
  4. import torchaudio
  5.  
  6. print("python version:", sys.version)
  7. print("python version info:", sys.version_info)
  8. print("torch version:", torch.__version__)
  9. print("cuda version (torch):", torch.version.cuda)
  10. print("torchvision version:", torchvision.__version__)
  11. print("torchaudio version:", torchaudio.__version__)
  12. print("cuda available:", torch.cuda.is_available())
  13.  
  14. try:
  15.     import flash_attn
  16.     print("flash-attention version:", flash_attn.__version__)
  17. except ImportError:
  18.     print("flash-attention is not installed or cannot be imported")
  19.  
  20. try:
  21.     import triton
  22.     print("triton version:", triton.__version__)
  23. except ImportError:
  24.     print("triton is not installed or cannot be imported")
  25.  
  26. try:
  27.     import sageattention
  28.     print("sageattention version:", sageattention.__version__)
  29. except ImportError:
  30.     print("sageattention is not installed or cannot be imported")
  31. except AttributeError:
  32.     print("sageattention is installed but has no __version__ attribute")
  33.    
  34. try:
  35.     import decord
  36.     print("decord version:", decord.__version__)
  37. except ImportError:
  38.     print("decord is not installed or cannot be imported")
  39. except AttributeError:
  40.     print("decord is installed but has no __version__ attribute")
  41.  
  42. try:
  43.     import diffusers
  44.     print("diffusers version:", diffusers.__version__)
  45. except ImportError:
  46.     print("diffusers is not installed or cannot be imported")
  47. except AttributeError:
  48.     print("diffusers is installed but has no __version__ attribute")
  49.  
  50. try:
  51.     import pillow
  52.     print("pillow version:", pillow.__version__)
  53. except ImportError:
  54.     print("pillow is not installed or cannot be imported")
  55. except AttributeError:
  56.     print("pillow is installed but has no __version__ attribute")
  57.  
  58. try:
  59.     import einops
  60.     print("einops version:", einops.__version__)
  61. except ImportError:
  62.     print("einops is not installed or cannot be imported")
  63. except AttributeError:
  64.     print("einops is installed but has no __version__ attribute")
  65.  
  66. try:
  67.     import scipy
  68.     print("scipy version:", scipy.__version__)
  69. except ImportError:
  70.     print("scipy is not installed or cannot be imported")
  71. except AttributeError:
  72.     print("scipy is installed but has no __version__ attribute")
  73.  
  74. try:
  75.     import numpy
  76.     print("numpy version:", numpy.__version__)
  77. except ImportError:
  78.     print("numpy is not installed or cannot be imported")
  79. except AttributeError:
  80.     print("numpy is installed but has no __version__ attribute")
  81.  
  82. try:
  83.     import cv2
  84.     print("opencv-python version:", cv2.__version__)
  85. except ImportError:
  86.     print("opencv-python is not installed or cannot be imported")
  87. except AttributeError:
  88.     print("opencv-python is installed but has no __version__ attribute")
  89.  
  90. try:
  91.     import huggingface_hub
  92.     print("huggingface_hub version:", huggingface_hub.__version__)
  93. except ImportError:
  94.     print("huggingface_hub is not installed or cannot be imported")
  95. except AttributeError:
  96.     print("huggingface_hub is installed but has no __version__ attribute")
  97.  
  98. try:
  99.     import omegaconf
  100.     print("omegaconf version:", omegaconf.__version__)
  101. except ImportError:
  102.     print("omegaconf is not installed or cannot be imported")
  103. except AttributeError:
  104.     print("omegaconf is installed but has no __version__ attribute")
  105.  
  106. try:
  107.     import einops
  108.     print("einops version:", einops.__version__)
  109. except ImportError:
  110.     print("einops is not installed or cannot be imported")
  111. except AttributeError:
  112.     print("einops is installed but has no __version__ attribute")
  113.  
  114. try:
  115.     import accelerate
  116.     print("accelerate version:", accelerate.__version__)
  117. except ImportError:
  118.     print("accelerate is not installed or cannot be imported")
  119. except AttributeError:
  120.     print("accelerate is installed but has no __version__ attribute")
  121.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement