Closed ivi-42 closed 1 year ago
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.
pytorch
works correctly by running python -c "import torch"
?torch
in the directory you run your python
from?It seems that either your
pytorch
installation is broken or that you're runningpython
from the same directory where you downloadedpytorch
's source code.
- can you check if your
pytorch
works correctly by runningpython -c "import torch"
?- can you make sure there's no directory named
torch
in the directory you run yourpython
from?
sir,I have a same problem,and I have checked the 1.can.. Now,the cansole shows that Traceback (most recent call last):
File "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.
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 thetorch._C
namespace. This can occur when using theinstall
workflow. e.g. $ python setup.py install && python -c "import torch"