Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error Windows #22

Open
Pranav186 opened this issue Mar 11, 2021 · 10 comments
Open

Build error Windows #22

Pranav186 opened this issue Mar 11, 2021 · 10 comments

Comments

@Pranav186
Copy link

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.
@rithik25
Copy link

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

@GandhiAndy
Copy link

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.

@yuxiaooye
Copy link

yuxiaooye commented Nov 25, 2021

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.

@IOwenI
Copy link

IOwenI commented Dec 8, 2021

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
Copy link

IOwenI commented Dec 11, 2021

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,不胜感激!

@davi-v
Copy link

davi-v commented Feb 7, 2022

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.

@HzcIrving
Copy link

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!

@adhocmaster
Copy link

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

@aegiraldob
Copy link

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

@davi-v
Copy link

davi-v commented Oct 28, 2022

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants