Repository: pytorch
Issue: `import torch` takes forever
Labels: needs reproduction,triaged

### 🐛 Describe the bug

Hi! I am starting to learn and use PyTorch. However, it has one problem. Import torch is taking straight up forever. 

I wrote a StackOverflow question describing my issue: https://stackoverflow.com/questions/79049542/pytorch-import-stuck-on-torch-version.

I don't know how, why, or what caused it to happen. I tried reinstalling torch (both a current and an older version), reloading VSCode window, and all sorts of things. This happens to me on both Linux and Windows, and I don't know why it happens, but it is very frustrating. It is even crazier when I could run it some time ago, but now it completely refuses to work and I don't know why.

And no, the collect_env.py file doesn't work. It imports torch, and of course I just can't.

Here are some additional information for those who want to investigate:

My `requirements.txt` file for the venv I am running in:
```
--index-url https://download.pytorch.org/whl/cpu
--extra-index-url https://pypi.org/simple
torch==2.3.1
torchinfo
torchvision
pytorch-lightning
numpy
matplotlib
pandas

scikit-learn
torchinfo
ISLP
ipykernel
ipython
jupyter
```

The code I was trying to run:

```
import torch
x = torch.rand(5, 3)
print(x)
```

The log for `python -v -c "import torch"`:
```
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# /usr/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/encodings/__init__.py
# code object from '/usr/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <class '_frozen_importlib.FrozenImporter'>
# /usr/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc matches /usr/lib/python3.12/encodings/aliases.py
# code object from '/usr/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7fe15e0>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7fe0c20>
# /usr/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc matches /usr/lib/python3.12/encodings/utf_8.py
# code object from '/usr/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7fe3b60>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <class '_frozen_importlib.FrozenImporter'>
import 'io' # <class '_frozen_importlib.FrozenImporter'>
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <class '_frozen_importlib.FrozenImporter'>
import '_collections_abc' # <class '_frozen_importlib.FrozenImporter'>
import 'genericpath' # <class '_frozen_importlib.FrozenImporter'>
import 'posixpath' # <class '_frozen_importlib.FrozenImporter'>
import 'os' # <class '_frozen_importlib.FrozenImporter'>
import '_sitebuiltins' # <class '_frozen_importlib.FrozenImporter'>
Processing global site-packages
Adding directory: '/home/minhduc/Documents/ML/lib/python3.12/site-packages'
Processing .pth file: '/home/minhduc/Documents/ML/lib/python3.12/site-packages/distutils-precedence.pth'
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/_distutils_hack/__pycache__/__init__.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/_distutils_hack/__init__.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/_distutils_hack/__pycache__/__init__.cpython-312.pyc'
import '_distutils_hack' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7fff140>
Processing user site-packages
Processing global site-packages
Adding directory: '/home/minhduc/Documents/ML/lib/python3.12/site-packages'
Processing .pth file: '/home/minhduc/Documents/ML/lib/python3.12/site-packages/distutils-precedence.pth'
# /usr/lib/python3.12/__pycache__/sitecustomize.cpython-312.pyc matches /usr/lib/python3.12/sitecustomize.py
# code object from '/usr/lib/python3.12/__pycache__/sitecustomize.cpython-312.pyc'
import 'sitecustomize' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7ffe180>
import 'site' # <class '_frozen_importlib.FrozenImporter'>
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/__init__.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__init__.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/__init__.cpython-312.pyc'
import 'math' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.12/__pycache__/platform.cpython-312.pyc matches /usr/lib/python3.12/platform.py
# code object from '/usr/lib/python3.12/__pycache__/platform.cpython-312.pyc'
# /usr/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/collections/__init__.py
# code object from '/usr/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc'
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.12/__pycache__/keyword.cpython-312.pyc matches /usr/lib/python3.12/keyword.py
# code object from '/usr/lib/python3.12/__pycache__/keyword.cpython-312.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b5f560>
# /usr/lib/python3.12/__pycache__/operator.cpython-312.pyc matches /usr/lib/python3.12/operator.py
# code object from '/usr/lib/python3.12/__pycache__/operator.cpython-312.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b5fbc0>
# /usr/lib/python3.12/__pycache__/reprlib.cpython-312.pyc matches /usr/lib/python3.12/reprlib.py
# code object from '/usr/lib/python3.12/__pycache__/reprlib.cpython-312.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b74560>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b4ef00>
# /usr/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/re/__init__.py
# code object from '/usr/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/enum.cpython-312.pyc matches /usr/lib/python3.12/enum.py
# code object from '/usr/lib/python3.12/__pycache__/enum.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/types.cpython-312.pyc matches /usr/lib/python3.12/types.py
# code object from '/usr/lib/python3.12/__pycache__/types.cpython-312.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b4f9b0>
# /usr/lib/python3.12/__pycache__/functools.cpython-312.pyc matches /usr/lib/python3.12/functools.py
# code object from '/usr/lib/python3.12/__pycache__/functools.cpython-312.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b4f590>
import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b76c90>
# /usr/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc matches /usr/lib/python3.12/re/_compiler.py
# code object from '/usr/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc'
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc matches /usr/lib/python3.12/re/_parser.py
# code object from '/usr/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc'
# /usr/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc matches /usr/lib/python3.12/re/_constants.py
# code object from '/usr/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc'
import 're._constants' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7bce0f0>
import 're._parser' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7bccd10>
# /usr/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc matches /usr/lib/python3.12/re/_casefix.py
# code object from '/usr/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc'
import 're._casefix' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7bce240>
import 're._compiler' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7ba3800>
# /usr/lib/python3.12/__pycache__/copyreg.cpython-312.pyc matches /usr/lib/python3.12/copyreg.py
# code object from '/usr/lib/python3.12/__pycache__/copyreg.cpython-312.pyc'
import 'copyreg' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7bcf410>
import 're' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b5cd10>
import 'platform' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b4c920>
# /usr/lib/python3.12/__pycache__/textwrap.cpython-312.pyc matches /usr/lib/python3.12/textwrap.py
# code object from '/usr/lib/python3.12/__pycache__/textwrap.cpython-312.pyc'
import 'textwrap' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7b4ec90>
# /usr/lib/python3.12/ctypes/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/ctypes/__init__.py
# code object from '/usr/lib/python3.12/ctypes/__pycache__/__init__.cpython-312.pyc'
# extension module '_ctypes' loaded from '/usr/lib/python3.12/lib-dynload/_ctypes.cpython-312-x86_64-linux-gnu.so'
# extension module '_ctypes' executed from '/usr/lib/python3.12/lib-dynload/_ctypes.cpython-312-x86_64-linux-gnu.so'
import '_ctypes' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7357b7be9bb0>
# /usr/lib/python3.12/__pycache__/struct.cpython-312.pyc matches /usr/lib/python3.12/struct.py
# code object from '/usr/lib/python3.12/__pycache__/struct.cpython-312.pyc'
import '_struct' # <class '_frozen_importlib.BuiltinImporter'>
import 'struct' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7bea330>
# /usr/lib/python3.12/ctypes/__pycache__/_endian.cpython-312.pyc matches /usr/lib/python3.12/ctypes/_endian.py
# code object from '/usr/lib/python3.12/ctypes/__pycache__/_endian.cpython-312.pyc'
import 'ctypes._endian' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7beae10>
import 'ctypes' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7be83b0>
# /usr/lib/python3.12/__pycache__/inspect.cpython-312.pyc matches /usr/lib/python3.12/inspect.py
# code object from '/usr/lib/python3.12/__pycache__/inspect.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/ast.cpython-312.pyc matches /usr/lib/python3.12/ast.py
# code object from '/usr/lib/python3.12/__pycache__/ast.cpython-312.pyc'
import '_ast' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.12/__pycache__/contextlib.cpython-312.pyc matches /usr/lib/python3.12/contextlib.py
# code object from '/usr/lib/python3.12/__pycache__/contextlib.cpython-312.pyc'
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7178530>
import 'ast' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b711b4a0>
# /usr/lib/python3.12/__pycache__/dis.cpython-312.pyc matches /usr/lib/python3.12/dis.py
# code object from '/usr/lib/python3.12/__pycache__/dis.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/opcode.cpython-312.pyc matches /usr/lib/python3.12/opcode.py
# code object from '/usr/lib/python3.12/__pycache__/opcode.cpython-312.pyc'
import '_opcode' # <class '_frozen_importlib.BuiltinImporter'>
import 'opcode' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b717bfe0>
import 'dis' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71405f0>
# /usr/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc matches /usr/lib/python3.12/collections/abc.py
# code object from '/usr/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71a2330>
# /usr/lib/python3.12/importlib/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/importlib/__init__.py
# code object from '/usr/lib/python3.12/importlib/__pycache__/__init__.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/warnings.cpython-312.pyc matches /usr/lib/python3.12/warnings.py
# code object from '/usr/lib/python3.12/__pycache__/warnings.cpython-312.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71a1df0>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71a2180>
import 'importlib.machinery' # <class '_frozen_importlib.FrozenImporter'>
# /usr/lib/python3.12/__pycache__/linecache.cpython-312.pyc matches /usr/lib/python3.12/linecache.py
# code object from '/usr/lib/python3.12/__pycache__/linecache.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/tokenize.cpython-312.pyc matches /usr/lib/python3.12/tokenize.py
# code object from '/usr/lib/python3.12/__pycache__/tokenize.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/token.cpython-312.pyc matches /usr/lib/python3.12/token.py
# code object from '/usr/lib/python3.12/__pycache__/token.cpython-312.pyc'
import 'token' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71bd6d0>
import '_tokenize' # <class '_frozen_importlib.BuiltinImporter'>
import 'tokenize' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71bc2c0>
import 'linecache' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71a3f20>
import 'inspect' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7be9010>
# /usr/lib/python3.12/__pycache__/threading.cpython-312.pyc matches /usr/lib/python3.12/threading.py
# code object from '/usr/lib/python3.12/__pycache__/threading.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/_weakrefset.cpython-312.pyc matches /usr/lib/python3.12/_weakrefset.py
# code object from '/usr/lib/python3.12/__pycache__/_weakrefset.cpython-312.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71f53a0>
import 'threading' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71bc1d0>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/_utils.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_utils.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/_utils.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/traceback.cpython-312.pyc matches /usr/lib/python3.12/traceback.py
# code object from '/usr/lib/python3.12/__pycache__/traceback.cpython-312.pyc'
import 'traceback' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b701c590>
# /usr/lib/python3.12/__pycache__/typing.cpython-312.pyc matches /usr/lib/python3.12/typing.py
# code object from '/usr/lib/python3.12/__pycache__/typing.cpython-312.pyc'
import '_typing' # <class '_frozen_importlib.BuiltinImporter'>
import 'typing' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b701e780>
import 'torch._utils' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71f6c60>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/_utils_internal.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_utils_internal.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/_utils_internal.cpython-312.pyc'
# /usr/lib/python3.12/logging/__pycache__/__init__.cpython-312.pyc matches /usr/lib/python3.12/logging/__init__.py
# code object from '/usr/lib/python3.12/logging/__pycache__/__init__.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/weakref.cpython-312.pyc matches /usr/lib/python3.12/weakref.py
# code object from '/usr/lib/python3.12/__pycache__/weakref.cpython-312.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7095c40>
# /usr/lib/python3.12/__pycache__/string.cpython-312.pyc matches /usr/lib/python3.12/string.py
# code object from '/usr/lib/python3.12/__pycache__/string.cpython-312.pyc'
import '_string' # <class '_frozen_importlib.BuiltinImporter'>
import 'string' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7097200>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
import 'logging' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b7072330>
# /usr/lib/python3.12/__pycache__/tempfile.cpython-312.pyc matches /usr/lib/python3.12/tempfile.py
# code object from '/usr/lib/python3.12/__pycache__/tempfile.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/shutil.cpython-312.pyc matches /usr/lib/python3.12/shutil.py
# code object from '/usr/lib/python3.12/__pycache__/shutil.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/fnmatch.cpython-312.pyc matches /usr/lib/python3.12/fnmatch.py
# code object from '/usr/lib/python3.12/__pycache__/fnmatch.cpython-312.pyc'
import 'fnmatch' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70c7fe0>
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
import 'zlib' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.12/__pycache__/bz2.cpython-312.pyc matches /usr/lib/python3.12/bz2.py
# code object from '/usr/lib/python3.12/__pycache__/bz2.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/_compression.cpython-312.pyc matches /usr/lib/python3.12/_compression.py
# code object from '/usr/lib/python3.12/__pycache__/_compression.cpython-312.pyc'
import '_compression' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70fa5d0>
# extension module '_bz2' loaded from '/usr/lib/python3.12/lib-dynload/_bz2.cpython-312-x86_64-linux-gnu.so'
# extension module '_bz2' executed from '/usr/lib/python3.12/lib-dynload/_bz2.cpython-312-x86_64-linux-gnu.so'
import '_bz2' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7357b70fac00>
import 'bz2' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70f9b20>
# /usr/lib/python3.12/__pycache__/lzma.cpython-312.pyc matches /usr/lib/python3.12/lzma.py
# code object from '/usr/lib/python3.12/__pycache__/lzma.cpython-312.pyc'
# extension module '_lzma' loaded from '/usr/lib/python3.12/lib-dynload/_lzma.cpython-312-x86_64-linux-gnu.so'
# extension module '_lzma' executed from '/usr/lib/python3.12/lib-dynload/_lzma.cpython-312-x86_64-linux-gnu.so'
import '_lzma' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7357b70fb680>
import 'lzma' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70fadb0>
import 'shutil' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70c5f10>
# /usr/lib/python3.12/__pycache__/random.cpython-312.pyc matches /usr/lib/python3.12/random.py
# code object from '/usr/lib/python3.12/__pycache__/random.cpython-312.pyc'
# /usr/lib/python3.12/__pycache__/bisect.cpython-312.pyc matches /usr/lib/python3.12/bisect.py
# code object from '/usr/lib/python3.12/__pycache__/bisect.cpython-312.pyc'
import '_bisect' # <class '_frozen_importlib.BuiltinImporter'>
import 'bisect' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f09730>
import '_random' # <class '_frozen_importlib.BuiltinImporter'>
import '_sha2' # <class '_frozen_importlib.BuiltinImporter'>
import 'random' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70c65d0>
import 'tempfile' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b70c4470>
import 'torch._utils_internal' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b71f7b90>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/torch_version.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/torch_version.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/torch_version.cpython-312.pyc'
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/version.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/version.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/__pycache__/version.cpython-312.pyc'
import 'torch.version' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f09fd0>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/__pycache__/__init__.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/__init__.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/__pycache__/__init__.cpython-312.pyc'
import 'torch._vendor' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f0a1b0>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/__init__.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__init__.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/__init__.cpython-312.pyc'
import 'torch._vendor.packaging' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f0a060>
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/version.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/version.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/version.cpython-312.pyc'
# /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/_structures.cpython-312.pyc matches /home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/_structures.py
# code object from '/home/minhduc/Documents/ML/lib/python3.12/site-packages/torch/_vendor/packaging/__pycache__/_structures.cpython-312.pyc'
import 'torch._vendor.packaging._structures' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f0b1d0>
import 'torch._vendor.packaging.version' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f0a330>
import 'torch.torch_version' # <_frozen_importlib_external.SourceFileLoader object at 0x7357b6f09d00>
```

### Versions

`import torch` gets stuck so I'll do `pip list` instead
```
Package                   Version
------------------------- --------------
aiohappyeyeballs          2.4.3
aiohttp                   3.10.8
aiosignal                 1.3.1
anyio                     4.6.0
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
attrs                     24.2.0
autograd                  1.7.0
autograd-gamma            0.5.0
babel                     2.16.0
beautifulsoup4            4.12.3
bleach                    6.1.0
certifi                   2024.8.30
cffi                      1.17.1
charset-normalizer        3.3.2
comm                      0.2.2
contourpy                 1.3.0
cycler                    0.12.1
debugpy                   1.8.6
decorator                 5.1.1
defusedxml                0.7.1
executing                 2.1.0
fastjsonschema            2.20.0
filelock                  3.16.1
fonttools                 4.54.1
formulaic                 1.0.2
fqdn                      1.5.1
frozenlist                1.4.1
fsspec                    2024.9.0
h11                       0.14.0
httpcore                  1.0.6
httpx                     0.27.2
idna                      3.10
interface-meta            1.3.0
ipykernel                 6.29.5
ipython                   8.28.0
ipywidgets                8.1.5
ISLP                      0.4.0
isoduration               20.11.0
jedi                      0.19.1
Jinja2                    3.1.4
joblib                    1.4.2
json5                     0.9.25
jsonpointer               3.0.0
jsonschema                4.23.0
jsonschema-specifications 2023.12.1
jupyter                   1.1.1
jupyter_client            8.6.3
jupyter-console           6.6.3
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter_server            2.14.2
jupyter_server_terminals  0.5.3
jupyterlab                4.2.5
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.3
jupyterlab_widgets        3.0.13
kiwisolver                1.4.7
lifelines                 0.29.0
lightning-utilities       0.11.7
lxml                      5.3.0
MarkupSafe                2.1.5
matplotlib                3.9.2
matplotlib-inline         0.1.7
mistune                   3.0.2
mpmath                    1.3.0
multidict                 6.1.0
nbclient                  0.10.0
nbconvert                 7.16.4
nbformat                  5.10.4
nest-asyncio              1.6.0
networkx                  3.3
notebook                  7.2.2
notebook_shim             0.2.4
numpy                     1.26.4
nvidia-cublas-cu12        12.1.3.1
nvidia-cuda-cupti-cu12    12.1.105
nvidia-cuda-nvrtc-cu12    12.1.105
nvidia-cuda-runtime-cu12  12.1.105
nvidia-cudnn-cu12         9.1.0.70
nvidia-cufft-cu12         11.0.2.54
nvidia-curand-cu12        10.3.2.106
nvidia-cusolver-cu12      11.4.5.107
nvidia-cusparse-cu12      12.1.0.106
nvidia-nccl-cu12          2.20.5
nvidia-nvjitlink-cu12     12.6.77
nvidia-nvtx-cu12          12.1.105
overrides                 7.7.0
packaging                 24.1
pandas                    2.2.3
pandocfilters             1.5.1
parso                     0.8.4
patsy                     0.5.6
pexpect                   4.9.0
pillow                    10.4.0
pip                       24.0
platformdirs              4.3.6
progressbar2              4.5.0
prometheus_client         0.21.0
prompt_toolkit            3.0.48
psutil                    6.0.0
ptyprocess                0.7.0
pure_eval                 0.2.3
pycparser                 2.22
pygam                     0.9.1
Pygments                  2.18.0
pyparsing                 3.1.4
python-dateutil           2.9.0.post0
python-json-logger        2.0.7
python-utils              3.9.0
pytorch-lightning         2.4.0
pytz                      2024.2
PyYAML                    6.0.2
pyzmq                     26.2.0
referencing               0.35.1
requests                  2.32.3
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rpds-py                   0.20.0
scikit-learn              1.5.2
scipy                     1.11.4
Send2Trash                1.8.3
setuptools                75.1.0
six                       1.16.0
sniffio                   1.3.1
soupsieve                 2.6
stack-data                0.6.3
statsmodels               0.14.3
sympy                     1.13.3
terminado                 0.18.1
threadpoolctl             3.5.0
tinycss2                  1.3.0
torch                     2.3.1+cpu
torchinfo                 1.8.0
torchmetrics              1.4.2
torchvision               0.18.1+cpu
tornado                   6.4.1
tqdm                      4.66.5
traitlets                 5.14.3
triton                    3.0.0
types-python-dateutil     2.9.0.20241003
typing_extensions         4.12.2
tzdata                    2024.2
uri-template              1.3.0
urllib3                   2.2.3
wcwidth                   0.2.13
webcolors                 24.8.0
webencodings              0.5.1
websocket-client          1.8.0
widgetsnbextension        4.0.13
wrapt                     1.16.0
yarl                      1.13.1
```