Skip to content

Build error Windows #22

Open
Open

Description

@Pranav186

Hi,
I am facing this error while building on Windows after running the command python setup.py build. Any idea how to go about it?

running build
running build_ext
The system cannot find the file specified
CMake Error: Generator: execution of make failed. Make command was: nmake /nologo &&
Traceback (most recent call last):
  File "setup.py", line 49, in <module>
    'Topic :: Software Development :: Libraries :: Python Modules',
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 20, in run
    subprocess.check_call(['cmake', '--build', '.'], cwd=build_dir)
  File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 1.

Activity

  1. rithik25 commented on Jul 21, 2021

    @rithik25

    I'm facing the same problem too. Were you able to solve this?

  2. GandhiAndy commented on Sep 8, 2021

    @GandhiAndy

    Facing this issue on Windows and Arch Linux using Python 3.6. Not too familiar with the CMake process, as why I'm attempting to use the Cython bindings. I will attempt to diagnose the issue, but please let us know if you came across a solution.

  3. yuxiaooye commented on Nov 25, 2021

    @yuxiaooye

    I fix this error in the following ways:
    1 first run python setup.py build (facing the same error)
    2 then delete the folder 'build'
    3 run python setup.py build the second time
    Snipaste_2021-11-25_18-23-47
    but I don't know the reason.

  4. IOwenI commented on Dec 8, 2021

    @IOwenI

    Hi, I am facing this error while building on Windows after running the command python setup.py build. Any idea how to go about it?

    running build
    running build_ext
    The system cannot find the file specified
    CMake Error: Generator: execution of make failed. Make command was: nmake /nologo &&
    Traceback (most recent call last):
      File "setup.py", line 49, in <module>
        'Topic :: Software Development :: Libraries :: Python Modules',
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "setup.py", line 20, in run
        subprocess.check_call(['cmake', '--build', '.'], cwd=build_dir)
      File "C:\Users\pranav\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 1.
    

    maybe you can check your vs c++, reinstall it and try again

  5. IOwenI commented on Dec 11, 2021

    @IOwenI

    I fix this error in the following ways: 1 first run python setup.py build (facing the same error) 2 then delete the folder 'build' 3 run python setup.py build the second time Snipaste_2021-11-25_18-23-47 but I don't know the reason.

    请问你是使用windows完成的吗?我感觉你的截图和我用windows区别有点大,如果你是用Windows完成的方便指导一下我吗,这是我的联系方式1024883943@qq.com,不胜感激!

  6. davi-v commented on Feb 7, 2022

    @davi-v

    I had the same problem. Here are the steps I took that worked: I used CMake 3.22.2 and Visual Studio 2022. Then I used CMake-GUI to configure the input folder to the root folder (with CMakeLists.txt), the output folder the build folder. It then generated Visual Studio 2022 projects. Then open the solution file (.sln) in the build folder, select Release, build everything. For some (weird) reason the output library RVO.lib is in build/src/Release/RVO.lib. Then manually copy RVO.lib to the root folder (where setup.py and CMakeLists.txt) is located. Then execute the python commands to build and install.

  7. HzcIrving commented on Jul 2, 2022

    @HzcIrving

    Hi, I also have a similar issue with Windows 11.
    When I carry out python setup.py build , I got the following error:
    image

    I wonder if anyone could help me. Thank you very much!

  8. adhocmaster commented on Aug 27, 2022

    @adhocmaster

    I had the same problem. Here are the steps I took that worked: I used CMake 3.22.2 and Visual Studio 2022. Then I used CMake-GUI to configure the input folder to the root folder (with CMakeLists.txt), the output folder the build folder. It then generated Visual Studio 2022 projects. Then open the solution file (.sln) in the build folder, select Release, build everything. For some (weird) reason the output library RVO.lib is in build/src/Release/RVO.lib. Then manually copy RVO.lib to the root folder (where setup.py and CMakeLists.txt) is located. Then execute the python commands to build and install.

    This solution works

  9. aegiraldob commented on Oct 27, 2022

    @aegiraldob

    I had the same problem. Here are the steps I took that worked: I used CMake 3.22.2 and Visual Studio 2022. Then I used CMake-GUI to configure the input folder to the root folder (with CMakeLists.txt), the output folder the build folder. It then generated Visual Studio 2022 projects. Then open the solution file (.sln) in the build folder, select Release, build everything. For some (weird) reason the output library RVO.lib is in build/src/Release/RVO.lib. Then manually copy RVO.lib to the root folder (where setup.py and CMakeLists.txt) is located. Then execute the python commands to build and install.

    @davi-v Hi, could you please re explain the part when you configure the input folder to the root folder and the output folder the build folder please. It is not clear for me what you did and so far this is the only solution that someone has provided

  10. davi-v commented on Oct 28, 2022

    @davi-v

    @aegiraldob Ok. So here's a more detailed step by step:

    1. Download CMake https://github.com/Kitware/CMake/releases/download/v3.25.0-rc2/cmake-3.25.0-rc2-windows-x86_64.zip, unpack it, you know the drill.
    2. Download src https://github.com/sybrenstuvel/Python-RVO2/archive/refs/heads/main.zip
    3. Unpack that zip. You should have a directory Python-RVO2-main, with CMakeLists.txt inside it. Example: C:\Users\User\Downloads\Python-RVO2-main\CMakeLists.txt. What I meant by root folder, is C:\Users\User\Downloads\Python-RVO2-main.
    4. Open cmake-gui.exe. In "Where is the source code:", put your root folder (e.g. C:\Users\User\Downloads\Python-RVO2-main). In "Where to build the binaries:", put something like C:/Users/User/Downloads/Python-RVO2-main/mybuild, which will automatically create the mybuild directory.
    5. Click Configure on bottom left, click yes to accept to create the mybuild directory, choose "Visual Studio 17 2022", "Use default native compilers" (in my case, it was already defaulted to that).
    6. Click Finish
    7. Click Generate
    8. Inside mybuild directory, click RVO.sln
    9. Select Release on the top (it will be Debug there probably).
    10. Build everything with Ctrl+Shift+B, or right clicking the Solution 'RVO' (13 of 13 projects) -> Build Solution
    11. RVO.lib will be located in mybuild\src\Release (or simply Ctrl+F for it). Manually copy it to the root folder
    12. Then, execute the python commands from their README.md in the root folder to finish the python installation: pip install -r requirements.txt, pip install Cython, python setup.py build, python setup.py install.
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