-
Notifications
You must be signed in to change notification settings - Fork 11.1k
PackageNotFoundError: No package metadata was found for torch #358
-
I just cloned repository and started to run.I get following error.
PS: I just setup my VS code, installed git python etc.please suggest how to fox this error.
Beta Was this translation helpful? Give feedback.
All reactions
Have you installed torch
? I suggest you pip install -r requirements.txt
Replies: 3 comments 3 replies
-
Have you installed torch
? I suggest you pip install -r requirements.txt
Beta Was this translation helpful? Give feedback.
All reactions
-
I can confirm, the PackageNotFoundError
usually occurs of the required packages are not installed, yet. I recommend running
pip install -r requirements.txt
in your terminal as suggested by @chhenning.
Alternatively, you can directly execute
!pip install -r https://raw.githubusercontent.com/rasbt/LLMs-from-scratch/main/requirements.txt
in a notebook cell.
Please let us know in case you are bumping into any issues with this.
Beta Was this translation helpful? Give feedback.
All reactions
-
I had this same issue, despite confirming torch was installed in my virtualenv (I could "import torch" from the python console). Turned out to be an issue only when running the notebook from PyCharm. Opening up the notebook using jupyter-lab directly worked fine.
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah, PackageNotFoundError: No package metadata was found for torch
sounds like something is corrupt there, otherwise it would say ModuleNotFoundError: No module named 'torch'
. Please make sure to use uv
or pip
when installing the packages, other packages managers like conda
might lead to problems.
And after having installed new packages, please also don't forget to restart the kernel.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi same problem here. I run in vscode and python 3.11. I'm using a conda environment.
I tried pip install -r requirements.txt
twice and it says all requirements satisfied.
Finally found that by conda install pytorch
will solve the problem. Also found that if you use pip install
will cause problems. Make sure to use the same way to install packages
Hope this helps.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for sharing! I suspect the culprit here is that there are multiple instances of Python on that machine, and pip
then links to the wrong one. E.g., you could check via which pip
in the terminal
Beta Was this translation helpful? Give feedback.