#1225·torch7

Torch Installation Problems

Author: SulaimanSnomaCreated Jun 18, 2020Updated Dec 12, 2024

I am having errors for the installation of TORCH on windows 10 both via conda and pip installation procedure. The below are errors I used to see when using the conda and the pip method. Please how do I install a TORCH successfully on my windows 10?

### 1. conda install torch Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

torch Current channels:

https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org and use the search bar at the top of the page.

### 2. pip install torch Collecting torch Using cached torch-0.1.2.post2.tar.gz (128 kB) Requirement already satisfied: pyyaml in c:\\users\ncc\anaconda3\lib\site-packages (from torch) (5.3) Building wheels for collected packages: torch Building wheel for torch (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'c:\\users\ncc\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"'; file='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-wheel-18_df4kc' cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch Complete output (30 lines): running bdist_wheel running build running build_deps Traceback (most recent call last): File "", line 1, in File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py", line 265, in description="Tensors and Dynamic neural networks in Python with strong GPU acceleration", File "c:\\users\ncc\anaconda3\lib\site-packages\setuptools_init_.py", line 161, in setup return distutils.core.setup(**attrs) File "c:\\users\ncc\anaconda3\lib\distutils\core.py", line 148, in setup dist.run_commands() File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "c:\\users\ncc\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 223, in run self.run_command('build') File "c:\\users\ncc\anaconda3\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "c:\\users\ncc\anaconda3\lib\distutils\command\build.py", line 135, in run self.run_command(cmd_name) File "c:\\users\ncc\anaconda3\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py", line 51, in run from tools.nnwrap import generate_wrappers as generate_nn_wrappers ModuleNotFoundError: No module named 'tools.nnwrap' ERROR: Failed building wheel for torch Running setup.py clean for torch ERROR: Command errored out with exit status 1: command: 'c:\\users\ncc\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"'; file='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' clean --all cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch Complete output (2 lines): running clean error: [Errno 2] No such file or directory: '.gitignore' ERROR: Failed cleaning build dir for torch Failed to build torch Installing collected packages: torch Running setup.py install for torch ... error ERROR: Command errored out with exit status 1: command: 'c:\\users\ncc\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"'; file='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\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\Public\Documents\Wondershare\CreatorTemp\pip-record-hhnohi47\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\\users\ncc\anaconda3\Include\torch' cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch Complete output (23 lines): running install running build_deps Traceback (most recent call last): File "", line 1, in File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py", line 265, in description="Tensors and Dynamic neural networks in Python with strong GPU acceleration", File "c:\\users\ncc\anaconda3\lib\site-packages\setuptools_init_.py", line 161, in setup return distutils.core.setup(**attrs) File "c:\\users\ncc\anaconda3\lib\distutils\core.py", line 148, in setup dist.run_commands() File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py", line 99, in run self.run_command('build_deps') File "c:\\users\ncc\anaconda3\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "c:\\users\ncc\anaconda3\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\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\ncc\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\torch\setup.py'"'"'; file='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3tvog4zh\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\Public\Documents\Wondershare\CreatorTemp\pip-record-hhnohi47\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\\users\ncc\anaconda3\Include\torch' Check the logs for full command output.