Python-RVO2 icon indicating copy to clipboard operation
Python-RVO2 copied to clipboard

Build error Windows

Open Pranav186 opened this issue 4 years ago • 10 comments
trafficstars

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.

Pranav186 avatar Mar 11 '21 05:03 Pranav186

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

rithik25 avatar Jul 21 '21 01:07 rithik25

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.

GandhiAndy avatar Sep 08 '21 13:09 GandhiAndy

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.

yuxiaooye avatar Nov 25 '21 10:11 yuxiaooye

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

IOwenI avatar Dec 08 '21 14:12 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完成的方便指导一下我吗,这是我的联系方式[email protected],不胜感激!

IOwenI avatar Dec 11 '21 03:12 IOwenI

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 avatar Feb 07 '22 19:02 davi-v

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!

HzcIrving avatar Jul 02 '22 07:07 HzcIrving

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

adhocmaster avatar Aug 27 '22 01:08 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.

@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

aegiraldob avatar Oct 27 '22 22:10 aegiraldob

@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.

davi-v avatar Oct 28 '22 04:10 davi-v