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

求助:window平台clone源码使用pip install -r requirements.txt报错 #613

Closed
broadth opened this issue Feb 27, 2024 · 4 comments
Closed

Comments

@broadth
Copy link

broadth commented Feb 27, 2024

这该如何应对?
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
_CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
-- Building for: NMake Makefiles
CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:17 (project):
    Running

     'nmake' '-?'

    failed with:

     绯荤粺鎵句笉鍒版寚瀹氱殑鏂囦欢銆\x82


  CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
  CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
  -- Configuring incomplete, errors occurred!
  CMake is in the system path. Version:               cmake version 3.28.3

  CMake suite maintained and supported by Kitware (kitware.com/cmake).
  Traceback (most recent call last):
    File "D:\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "D:\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "D:\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\18485\AppData\Local\Temp\pip-build-env-sca372l7\overlay\Lib\site-packages\setuptools\build_meta.py", line 162, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "C:\Users\18485\AppData\Local\Temp\pip-build-env-sca372l7\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in _get_build_requires
      self.run_setup()
    File "C:\Users\18485\AppData\Local\Temp\pip-build-env-sca372l7\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 191, in <module>
    File "D:\Python\Python310\lib\subprocess.py", line 457, in check_returncode
      raise CalledProcessError(self.returncode, self.args, self.stdout,
  subprocess.CalledProcessError: Command '['cmake', '..', '-DHTS_ENGINE_INCLUDE_DIR=.', '-DHTS_ENGINE_LIB=dummy']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

image

@KamioRinn
Copy link
Contributor

检查cmake相关环境

@RVC-Boss
Copy link
Owner

有挺多解决办法
1、参考这个要先装vs2017一些组件的方法
https://blog.csdn.net/weixin_42033112/article/details/133427964
2、嫌麻烦的话,可以去github里面的prezip下整合包,把runtime-Lib-site-packages里面对应的文件夹直接拷过去,那个是已经编译好的

@broadth
Copy link
Author

broadth commented Feb 28, 2024

感谢诸位的帮助,此问题现已解决。
特别感谢RVC-Boss大佬提供的解决办法,行之有效。现将我的解决步骤罗列一下,以期能给后面踩了同样坑的人以帮助:

1、安装Visual Studio Enterprise 2017。

参照上面RVC-Boss大佬提供的博客地址和步骤安装Visual Studio Enterprise 2017。软件地址:博客
如果找不到下载地址,就选择加入免费 Dev Essentials 计划。这样就能下载了
image

2、配置环境变量。

配置cmake环境变量:Enterprise安装地址\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
配置MSVC环境变量:Enterprise安装地址\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64
其他
做完上面的两步就可以解决这个问题了。最后命令行执行一下安装命令就完事了:
pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

@dingxinal
Copy link

找不到VS 2017下载链接的指路:https://stackoverflow.com/a/78644904

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

No branches or pull requests

4 participants