Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no module named torch_npu._C #24

Open
ShiBoyu0204 opened this issue Mar 11, 2024 · 3 comments
Open

no module named torch_npu._C #24

ShiBoyu0204 opened this issue Mar 11, 2024 · 3 comments

Comments

@ShiBoyu0204
Copy link

torch版本2.1 python版本3.8 执行python3 -c "import torch;import torch_npu; a = torch.randn(3, 4).npu(); print(a + a);"命令时,产生错误:
Traceback (most recent call last): File "/data/package/pytorch/torch_npu/__init__.py", line 14, in <module> import torch_npu.npu File "/data/package/pytorch/torch_npu/npu/__init__.py", line 111, in <module> from .utils import (synchronize, device_count, can_device_access_peer, set_device, current_device, get_device_name, File "/data/package/pytorch/torch_npu/npu/utils.py", line 11, in <module> import torch_npu._C ModuleNotFoundError: No module named 'torch_npu._C' Traceback (most recent call last): File "<string>", line 1, in <module> File "/data/package/pytorch/torch_npu/__init__.py", line 37, in <module> import torch_npu.npu.amp File "/data/package/pytorch/torch_npu/npu/__init__.py", line 111, in <module> from .utils import (synchronize, device_count, can_device_access_peer, set_device, current_device, get_device_name, File "/data/package/pytorch/torch_npu/npu/utils.py", line 11, in <module> import torch_npu._C ModuleNotFoundError: No module named 'torch_npu._C'

@yunyiyun
Copy link

是否是在编译目录下运行了这脚本,请切换到其他目录下运行

@supercz
Copy link

supercz commented Apr 30, 2024

同问。也遇到了No module named 'torch_npu._C'
image

@shink
Copy link

shink commented Jul 9, 2024

源码安装的话,在其他目录下执行 python 即可解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants