Problems with Importing PyTorch for Snake ML Algorithm w/ Patrick Loeber

Hello. I am new to using PyTorch, and am trying to follow the tutorial for creating a snake ML algorithm (https://www.youtube.com/watch?v=L8ypSXwyBds). I got the program to work on my Mac, but it simply does not work with my Chromebook running Linux. I am using VS Code to run both programs. The source code can be found here: GitHub - patrickloeber/snake-ai-pytorch. When I run the program, This is what appears in the terminal:
Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "/home/jamballou/PyGames/Snake ML/snake-ai-pytorch-main/agent.py", line 6, in <module> from model import Linear_QNet, QTrainer File "/home/jamballou/PyGames/Snake ML/snake-ai-pytorch-main/model.py", line 2, in <module> import torch.nn as nn File "/home/jamballou/.local/lib/python3.9/site-packages/torch/nn/__init__.py", line 1, in <module> from .modules import * # noqa: F403 File "/home/jamballou/.local/lib/python3.9/site-packages/torch/nn/modules/__init__.py", line 1, in <module> from .module import Module File "/home/jamballou/.local/lib/python3.9/site-packages/torch/nn/modules/module.py", line 8, in <module> from torch._prims_common import DeviceLikeType ModuleNotFoundError: No module named 'torch._prims_common'
I think the problem has to do with Importing the PyTorch modules. I have tried uninstalling and reinstalling all the used packages in this project, and even running the project from a virtual environment using virtualenv. As I said, this program works perfectly on my Mac, so I am baffled as to why it does not work on my Chromebook. If anyone could help, that would be much appreciated.

Your PyTorch version might be too old. Could you check it via torch.__version__ and update to the latest stable or nightly version, if possible?

Thank you for replying. PyTorch is the latest version, 2.2.

I cannot reproduce the issue using the latest 2.3.0 release and 2.2.2:

>>> import torch
>>> torch.__version__
'2.3.0+cu121'
>>> from torch._prims_common import DeviceLikeType
>>> DeviceLikeType
typing.Union[str, torch.device, int]
>>> import torch
>>> torch.__version__
'2.2.2+cu121'
>>> from torch._prims_common import DeviceLikeType
>>> DeviceLikeType
typing.Union[str, torch.device, int]

Ok, thanks for all your help. Since the program works on my Mac, I won’t worry about fixing it on the Chromebook. Thanks again for your help.