ModuleNotFoundError:没有名为“tools.nnwrap"的模块 [英] ModuleNotFoundError: No module named 'tools.nnwrap'
问题描述
我正在尝试导入包torch".同样,我尝试使用如下的 pip 命令安装它,安装甚至开始了,但几秒钟后出现错误
下面是我执行的命令
pip install torch
我得到的错误:
from tools.nnwrap import generate_wrappers as generate_nn_wrappersModuleNotFoundError:没有名为tools.nnwrap"的模块
操作系统: Windows.IDE:pyCharm
我得到了与此问题相关的唯一链接,但我无法解释它.
https://www.gitmemory.com/torch
任何正在寻找解决方案的人请参考以下:
安装 Torch 的命令似乎没有按预期工作,相反,您可以尝试使用以下命令安装 PyTorch.
它正在工作并解决了我的上述问题.
运行下面的命令(对于下面指定的操作系统、包管理器、语言):
# for OS: Windows, package-manager: pip, Language: python3.6 (下面的命令只对提到的python 3.6有效)pip3 安装 https://download.pytorch.org/whl/cu90/torch-1.1.0-cp36-cp36m-win_amd64.whlpip3 安装 https://download.pytorch.org/whl/cu90/torchvision-0.3.0-cp36-cp36m-win_amd64.whl
对于安装的其他版本/类型的软件(操作系统、软件包、语言),必须从下面提到的链接生成命令.
https://pytorch.org/get-started/locally/>
另外,使用命令从终端在您的 IDE(如果您使用 PyCharm)中查找 Python 版本:python.如果它返回 32 位,这可能会发生,而是安装 Python 64 位.
I am trying to import a package "torch". For same, I tried to install it using pip command as below, installation even started but after few seconds it got error
below is the command that I executed
pip install torch
Error that I got:
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools.nnwrap'
OS: Windows. IDE : pyCharm
I got the only link related to this issue but I was not able to interpret it.
https://www.gitmemory.com/torch
Anyone who is looking for the solution refer below:
It seems command to install torch not is working as expected, instead, you can try to install PyTorch using below command.
It's working and solved my above-mentioned issue.
Run below command(for below-specified OS, package-manager, Language):
# for OS: Windows, package-manager: pip, Language: python3.6 (below command is valid for only mentioned python 3.6)
pip3 install https://download.pytorch.org/whl/cu90/torch-1.1.0-cp36-cp36m-win_amd64.whl
pip3 install https://download.pytorch.org/whl/cu90/torchvision-0.3.0-cp36-cp36m-win_amd64.whl
For another version/type of the software (OS, package, Language) installed, the command must be generated from the below-mentioned link.
https://pytorch.org/get-started/locally/
Also, look for the Python version in your IDE(If you are using PyCharm) from the terminal using the command: python. If it returns 32bit this could happen, instead install Python 64-bit.
这篇关于ModuleNotFoundError:没有名为“tools.nnwrap"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!