galai icon indicating copy to clipboard operation
galai copied to clipboard

Failed to load PyTorch C extensions:

Open ivi-42 opened this issue 2 years ago • 1 comments

raceback (most recent call last): File "C:\Users\user\PycharmProjects\pythonProject19\HOF.py", line 1, in import galai as gal File "C:\Users\user\PycharmProjects\pythonProject19\venv\lib\site-packages\galai_init_.py", line 1, in from galai.model import Model File "C:\Users\user\PycharmProjects\pythonProject19\venv\lib\site-packages\galai\model.py", line 2, in import torch File "C:\Users\user\PycharmProjects\pythonProject19\venv\lib\site-packages\torch_init_.py", line 209, in raise ImportError(textwrap.dedent(''' ImportError: Failed to load PyTorch C extensions: It appears that PyTorch has loaded the torch/_C folder of the PyTorch repository rather than the C extensions which are expected in the torch._C namespace. This can occur when using the install workflow. e.g. $ python setup.py install && python -c "import torch"

This error can generally be solved using the `develop` workflow
    $ python setup.py develop && python -c "import torch"  # This should succeed
or by running Python from a different directory.

I get this problem eheh, what should I do? Sorry for my incompetence 

ivi-42 avatar Nov 24 '22 18:11 ivi-42

It seems that either your pytorch installation is broken or that you're running python from the same directory where you downloaded pytorch's source code.

  1. can you check if your pytorch works correctly by running python -c "import torch"?
  2. can you make sure there's no directory named torch in the directory you run your python from?

mkardas avatar Nov 24 '22 18:11 mkardas