gpt4 book ai didi

python - 模块未找到错误: No module named ‘tools.nnwrap’ (windows)

转载 作者:行者123 更新时间:2023-11-30 09:03:29 25 4
gpt4 key购买 nike

我正在尝试安装 PyTorch,但每次都会抛出相同的错误(ModuleNotFoundError:没有名为“tools.nnwrap”的模块)。

这就是键入的内容:pip install torch

这就是我每次得到的:

Collecting torch
Using cached https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz

Requirement already satisfied: pyyaml in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from torch) (5.1.2)

Installing collected packages: torch

Running setup.py install for torch … error

ERROR: Command errored out with exit status 1:

command: ‘c:\users\user\appdata\local\programs\python\python37-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’; file=’"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\User\AppData\Local\Temp\pip-record-b_c49sh\install-record.txt’ --single-version-externally-managed --compile

cwd: C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch

Complete output (23 lines):

running install

running build_deps

Traceback (most recent call last):

File “<string>”, line 1, in <module>

File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 265, in
description=“Tensors and Dynamic neural networks in Python with strong GPU acceleration”,

File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\setuptools_init.py", line 145, in setup
return distutils.core.setup(**attrs)

File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\core.py”, line 148, in setup
dist.run_commands()

File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 966, in run_commands
self.run_command(cmd)

File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()

File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 99, in run
self.run_command(‘build_deps’)

File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\cmd.py”, line 313, in run_command
self.distribution.run_command(command)

File “C:\Users\User\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()

File “C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py”, line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers

ModuleNotFoundError: No module named ‘tools.nnwrap’
----------------------------------------
ERROR: Command errored out with exit status 1: ‘c:\users\user\appdata\local\programs\python\python37-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’; file=’"’"‘C:\Users\User\AppData\Local\Temp\pip-install-oegjniuy\torch\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\User\AppData\Local\Temp\pip-record-_b_c49sh\install-record.txt’ --single-version-externally-managed --compile Check the logs for full command output.

有谁知道如何修复这个错误!!

最佳答案

# for OS: Windows, package: 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

对于安装的软件的其他版本/类型(操作系统、软件包、语言),必须从下面提到的链接生成命令:https://pytorch.org/get-started/locally/

关于python - 模块未找到错误: No module named ‘tools.nnwrap’ (windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58956958/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com