Problem installing PyTorch

Betaglutamate: <p>Hi,</p>
<p>I am trying to install PyTorch and encounter an error.</p>
<p><code>pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html Looking in links: https://download.pytorch.org/whl/torch_stable.html ERROR: Could not find a version that satisfies the requirement torch==1.5.0+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch==1.5.0+cpu</code></p>
<p>I also tried downloading the Nightly version of pytorch but it fails to install</p>
<pre><code class="lang-auto">`pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
Looking in links: https://download.pytorch.org/whl/nightly/cpu/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\mzurb\appdata\local\programs\python\python38-32\lib\site-packages (from torch) (5.3.1)
Requirement already satisfied: six in c:\users\mzurb\appdata\roaming\python\python38\site-packages (from torchvision) (1.13.0)
Requirement already satisfied: numpy in c:\users\mzurb\appdata\roaming\python\python38\site-packages (from torchvision) (1.18.1)
Requirement already satisfied: pillow&gt;=4.1.1 in c:\users\mzurb\appdata\local\programs\python\python38-32\lib\site-packages (from torchvision) (7.1.1)
Building wheels for collected packages: torch
  Building wheel for torch (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\mzurb\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\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\mzurb\AppData\Local\Temp\pip-wheel-uffrbens'
       cwd: C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\torch\
  Complete output (30 lines):
  running bdist_wheel
  running build
  running build_deps
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\torch\setup.py", line 225, in &lt;module&gt;
      setup(name="torch", version="0.1.2.post2",
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\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\mzurb\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\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\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\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, torchvision
    Running setup.py install for torch ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\mzurb\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\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\mzurb\AppData\Local\Temp\pip-record-5pm9k8rb\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mzurb\appdata\local\programs\python\python38-32\Include\torch'
         cwd: C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\torch\
    Complete output (23 lines):
    running install
    running build_deps
    Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
      File "C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\torch\setup.py", line 225, in &lt;module&gt;
        setup(name="torch", version="0.1.2.post2",
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\torch\setup.py", line 99, in run
        self.run_command('build_deps')
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\mzurb\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\mzurb\AppData\Local\Temp\pip-install-ez13k_ui\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\mzurb\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\mzurb\\AppData\\Local\\Temp\\pip-install-ez13k_ui\\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\mzurb\AppData\Local\Temp\pip-record-5pm9k8rb\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mzurb\appdata\local\programs\python\python38-32\Include\torch' Check the logs for full command output. ```</code></pre>

peterjc123: <aside class="quote no-group" data-username="Betaglutamate" data-post="1" data-topic="84413">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/b/51bf81/48.png" class="avatar"> Betaglutamate:</div>
<blockquote>
<p><code>python38-32</code></p>
</blockquote>
</aside>
<p>Judging from the path of your python installation, it seems that you are using a x86 (32-bit) version of Python. Please use x64 one instead.</p>

Betaglutamate: <p>Thank you. Fixed by installing 64 bit version of python.</p>