Skip to content

Error installing Pytorch #5

Description

@IamAbhinav03

Specific Question

I have an error while installing PyTorch

OS, package manager and PyTorch Version

  • OS -Windows 7 32-bit
  • PyTorch Version -Stable(1.5)
  • Package Manager - Pip

Complete Error Log

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\user>pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://dow
nload.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

C:\Users\user>

Activity

  1. abhinavk001 commented on Jun 7, 2020

    @abhinavk001
    Contributor

    I too got this error. Found this on the website
    Screenshot (11)

  2. IamAbhinav03 commented on Jun 7, 2020

    @IamAbhinav03
    ContributorAuthor

    Will it work on Ubuntu 14.04?

  3. gksoriginals commented on Jun 7, 2020

    @gksoriginals
    Contributor

    Try

    pip install torch torchvision 
    
  4. IamAbhinav03 commented on Jun 7, 2020

    @IamAbhinav03
    ContributorAuthor

    @GopikrishnanSasikumar
    Is the command for Ubuntu or Windows??
    I tried to run it in windows some packages got installed and then I got a long error

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\user>pip install torch torchvision
    Collecting torch
      Downloading torch-0.1.2.post2.tar.gz (128 kB)
         |████████████████████████████████| 128 kB 85 kB/s
    Collecting torchvision
      Downloading torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB)
         |████████████████████████████████| 64 kB 108 kB/s
    Collecting pyyaml
      Downloading PyYAML-5.3.1-cp37-cp37m-win32.whl (196 kB)
         |████████████████████████████████| 196 kB 243 kB/s
    Collecting pillow>=4.1.1
      Downloading Pillow-7.1.2-cp37-cp37m-win32.whl (1.8 MB)
         |████████████████████████████████| 1.8 MB 469 kB/s
    Requirement already satisfied: numpy in c:\users\user\appdata\local\programs\pyt
    hon\python37-32\lib\site-packages (from torchvision) (1.18.4)
    Requirement already satisfied: six in c:\users\user\appdata\roaming\python\pytho
    n37\site-packages (from torchvision) (1.12.0)
    Building wheels for collected packages: torch
      Building wheel for torch (setup.py) ... 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\\Ap
    pData\\Local\\Temp\\pip-install-aiestgs7\\torch\\setup.py'"'"'; __file__='"'"'C:
    \\Users\\user\\AppData\\Local\\Temp\\pip-install-aiestgs7\\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\user\AppData\Local\Temp\pip-wheel-ziqou_b9'
           cwd: C:\Users\user\AppData\Local\Temp\pip-install-aiestgs7\torch\
      Complete output (30 lines):
      running bdist_wheel
      running build
      running build_deps
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:\Users\user\AppData\Local\Temp\pip-install-aiestgs7\torch\setup.py",
     line 265, in <module>
          description="Tensors and Dynamic neural networks in Python with strong GPU
     acceleration",
        File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packa
    ges\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\programs\python\python37-32\lib\site-packa
    ges\wheel\bdist_wheel.py", line 192, in run
          self.run_command('build')
        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\programs\python\python37-32\lib\distutils\
    command\build.py", line 135, in run
          self.run_command(cmd_name)
        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-aiestgs7\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\user\appdata\local\programs\python\python37-32\python.exe'
     -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\Ap
    pData\\Local\\Temp\\pip-install-aiestgs7\\torch\\setup.py'"'"'; __file__='"'"'C:
    \\Users\\user\\AppData\\Local\\Temp\\pip-install-aiestgs7\\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\user\AppData\Local\Temp\pip-install-aiestgs7\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: pyyaml, torch, pillow, torchvision
        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.ex
    e' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\
    AppData\\Local\\Temp\\pip-install-aiestgs7\\torch\\setup.py'"'"'; __file__='"'"'
    C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-aiestgs7\\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-jmx5slnq\instal
    l-record.txt' --single-version-externally-managed --compile --install-headers 'c
    :\users\user\appdata\local\programs\python\python37-32\Include\torch'
             cwd: C:\Users\user\AppData\Local\Temp\pip-install-aiestgs7\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-aiestgs7\torch\setup.py
    ", line 265, in <module>
            description="Tensors and Dynamic neural networks in Python with strong G
    PU acceleration",
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-pac
    kages\setuptools\__init__.py", line 145, in setup
            return distutils.core.setup(**attrs)
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\distutil
    s\core.py", line 148, in setup
            dist.run_commands()
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\distutil
    s\dist.py", line 966, in run_commands
            self.run_command(cmd)
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\distutil
    s\dist.py", line 985, in run_command
            cmd_obj.run()
          File "C:\Users\user\AppData\Local\Temp\pip-install-aiestgs7\torch\setup.py
    ", line 99, in run
            self.run_command('build_deps')
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\distutil
    s\cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "c:\users\user\appdata\local\programs\python\python37-32\lib\distutil
    s\dist.py", line 985, in run_command
            cmd_obj.run()
          File "C:\Users\user\AppData\Local\Temp\pip-install-aiestgs7\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\prog
    rams\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys
    .argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-aiestgs7\\tor
    ch\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-inst
    all-aiestgs7\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__f
    ile__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compil
    e(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Loca
    l\Temp\pip-record-jmx5slnq\install-record.txt' --single-version-externally-manag
    ed --compile --install-headers 'c:\users\user\appdata\local\programs\python\pyth
    on37-32\Include\torch' Check the logs for full command output.
    
    C:\Users\user>
    
  5. gksoriginals commented on Jun 7, 2020

    @gksoriginals
    Contributor

    @Thelonenlyhobbist can you try out the solution given in the first answer of this stackoverflow post ?

    https://stackoverflow.com/questions/56859803/modulenotfounderror-no-module-named-tools-nnwrap

  6. IamAbhinav03 commented on Jun 7, 2020

    @IamAbhinav03
    ContributorAuthor

    I tried that but I still got an error. I think the commands given in the links are for AMD based processors

  7. gksoriginals commented on Jun 7, 2020

    @gksoriginals
    Contributor

    @Thelonenlyhobbist I don’t know how to fix this. Do you have a Linux distro in your system ?

  8. IamAbhinav03 commented on Jun 7, 2020

    @IamAbhinav03
    ContributorAuthor

    Yeah. I have an Ubuntu 14.04

  9. gksoriginals commented on Jun 7, 2020

    @gksoriginals
    Contributor

    @Thelonenlyhobbist can you try installing PyTorch there ? Since I am not using a windows machine I am not familiar with this particular issue.

  10. kurianbenoy commented on Jun 8, 2020

    @kurianbenoy
    Contributor

    @Thelonenlyhobbist can you check below answer in Stackoverflow:

    https://stackoverflow.com/questions/48109783/pytorch-installation-in-windows-7-32-bit-sysytem

  11. gksoriginals commented on Jun 13, 2020

    @gksoriginals
    Contributor

    @Thelonenlyhobbist were you able to fix this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions