ssalome
(Salome)
March 11, 2020, 2:35pm
#1
Hi
On importing torch, I’m getting the following error. Can anyone help with this?
File “”, line 14, in
import torch
File “C:\Users\SALOME\Anaconda3\lib\site-packages\torch_init _.py”, line 83, in
all += [name for name in dir(_C)
NameError: name ‘_C’ is not defined
How did you install PyTorch? Using Conda?
ssalome
(Salome)
March 11, 2020, 5:52pm
#3
I installed pytorch using conda
but since this error threw up
I kind of reinstalled it as shown in the figure but the error persisted
ssalome
(Salome)
March 11, 2020, 5:55pm
#5
(base) C:\Users\SALOME>python
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
goes to next line
it runs fine on using the anaconda prompt but throws an error when i import it in Spyder
ssalome
(Salome)
March 11, 2020, 5:56pm
#6
import torch
Traceback (most recent call last):
File “”, line 1, in
import torch
File “C:\Users\SALOME\Anaconda3\lib\site-packages\torch_init _.py”, line 81, in
all += [name for name in dir(_C)
NameError: name ‘_C’ is not defined
this is the error i get on spyder
ssalome
(Salome)
March 11, 2020, 5:59pm
#7
it points to line 81 in the error in init .py