1

python import torch err,The torch version installed via pip is 1.7.0+cu110,I have wasted a day on this problem, does anyone know how to solve it, thank you

C:\Users\xujimu\Desktop\Bringing>python
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
 ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Program Files\Python36\lib\site-packages\torch\__init__.py", line 190, in <module>
    from torch._C import *
ImportError: numpy.core.multiarray failed to import
>>>
  • @M.Soyturk pip install -U numpy I tried and it didn't work –  Nov 08 '20 at 09:11
  • Try downgrading your Numpy per this question. Your error message doesn't quite match, but the illegal value messages look like a lot of the duplicates to this question. https://stackoverflow.com/questions/64654805/how-do-you-fix-runtimeerror-package-fails-to-pass-a-sanity-check-for-numpy-an – David Buck Nov 10 '20 at 19:20

1 Answers1

0

I think that this problem can be solved with an upgrade of pip and numpy:

pip install --upgrade pip
pip install -U numpy

(if you have multiple version of python maybe you must do python3.6 -m pip ...)

Nicola Landro
  • 336
  • 3
  • 17