0

I tried to use Anaconda to install PyTorch. I used

conda install -c peterjc123 pytorch

Then I use

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

When I run

import torch

I get the following error

NameError Traceback (most recent call last) in ----> 1 import torch

~\Anaconda3\lib\site-packages\torch__init__.py in

84 from torch._C import *

85

---> 86 all += [name for name in dir(_C)

87 if name[0] != '_' and

88 not name.endswith('Base')]

NameError: name '_C' is not defined

KHCheng
  • 621
  • 2
  • 6
  • 9
  • Possible duplicate of [name '\_C' is not defined pytorch+jupyter notebook](https://stackoverflow.com/questions/54408973/name-c-is-not-defined-pytorchjupyter-notebook) – kHarshit Feb 13 '19 at 14:02
  • Why don't you follow the official instructions [here](https://pytorch.org/get-started/locally/)? – Coolness Feb 13 '19 at 14:02
  • 1
    I tried to install Cython and It is shown that "Requirement already satisfied: Cython in c:\users\user\anaconda3\lib\site-packages" but the "name '_C' is not defined" is still there – KHCheng Feb 14 '19 at 04:57

0 Answers0