Cant install pytorch - ModuleNotFoundError: No module named 'tools.nnwrap'
I cannot install PyTorch on python 3.7. This error occurs for others but the suggested fixes did not work. I have tried instaling wheel, and importing tools but neither work.
Got error: ModuleNotFoundError: No module named 'tools.nnwrap'
ran command pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
full output: Looking in links: https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html Collecting torch Using cached torch-0.1.2.post2.tar.gz (128 kB) Collecting torchvision Using cached torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB) Requirement already satisfied: pyyaml in c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\lib\site-packages (from torch) (5.3.1) Collecting pillow&gt;=4.1.1 Using cached Pillow-7.2.0-cp37-cp37m-win32.whl (1.8 MB) Collecting numpy Using cached numpy-1.19.1-cp37-cp37m-win32.whl (10.9 MB) Collecting six Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Using legacy 'setup.py install' for torch, since package 'wheel' is not installed. Installing collected packages: torch, pillow, numpy, six, torchvision Running setup.py install for torch ... error ERROR: Command errored out with exit status 1: command: 'c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[ 0] = '&quot;'&quot;'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup .py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --reco rd 'C:\Users\LV7682\AppData\Local\Temp\pip-record-z5_fy7cc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lv7682\documents\repos\security _patch\spms\webapp\securitypatchmanagementsystem\venv\venv\include\site\python3.7\torch' cwd: C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\ Complete output (23 lines): running install running build_deps Traceback (most recent call last): File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt; File &quot;C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py&quot;, line 265, in &lt;module&gt; description=&quot;Tensors and Dynamic neural networks in Python with strong GPU acceleration&quot;, File &quot;c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\lib\site-packages\setuptools\__init__.py&quot;, line 163, in setup return distutils.core.setup(**attrs) File &quot;C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\core.py&quot;, line 148, in setup dist.run_commands() File &quot;C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py&quot;, line 966, in run_commands self.run_command(cmd) File &quot;C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py&quot;, line 985, in run_command cmd_obj.run() File &quot;C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py&quot;, line 99, in run self.run_command('build_deps') File &quot;C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\cmd.py&quot;, line 313, in run_command self.distribution.run_command(command) File &quot;C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py&quot;, line 985, in run_command cmd_obj.run() File &quot;C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py&quot;, 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\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\scripts\python.exe' -u -c 'import sys , setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'C:\\Users\\LV7682\\AppData\\Local\\Temp\\p ip-install-4b80gt33\\torch\\setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record 'C:\Users\LV7682\AppData\Local\Temp\pip-record-z5_fy7cc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\user s\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\include\site\python3.7\torch' Check the logs for full command output.

Fixed: needed to use python 64-bit not 32-bit
