1

I am getting this error RuntimeError: Numpy is not available, while trying to run the following line of code:

img = torch.from_numpy(np.array(pic, mode_to_nptype.get(pic.mode, np.uint8), copy=True))

Is there a way to solve this without the need to change python version?

Note: my python version is 3.10.

Rodrigo Laguna
  • 1,796
  • 1
  • 26
  • 46
Ala BR
  • 49
  • 1
  • 6
  • 1
    This topic seems to be about the same issue, yet it hasn't got any good answer https://stackoverflow.com/questions/71689095/how-to-solve-the-pytorch-runtimeerror-numpy-is-not-available-without-upgrading – Mateo Vial Jul 13 '22 at 10:40
  • Is there a way to downgrade the python version without re-installing it all over again? Because I am afraid if I uninstall python all my installed packages will be removed and I will re-install many of them again. – Ala BR Jul 13 '22 at 10:50
  • 2
    please use anaconda to manage these package error; trust me its the best – Prajot Kuvalekar Jul 13 '22 at 11:00
  • Thanks, it was fixed with anaconda, maybe because anaconda uses python 3.9 instead of 3.10 – Ala BR Jul 13 '22 at 21:31

0 Answers0