graphdeco-inria / diff-gaussian-rasterization

Other
839 stars 261 forks source link

" [WinError 2] The system cannot find the file specified" when building #8

Open RoyDubnium opened 1 year ago

RoyDubnium commented 1 year ago

Not sure if I should be posting this here or in the gaussian splatting repo, but when setting up the conda environment, the building of this package fails, with the following message to go off: "running build_ext error: [WinError 2] The system cannot find the file specified" This is incredibly perplexing, and it persists no matter what method I try and use to build it. My OS is windows 11 22H2, with CUDA 11 on an RTX 3060, if this helps.

RoyDubnium commented 1 year ago

To clarify, cl.exe's directory is in my path, and the full, verbose output is:


Using pip 22.3.1 from E:\ProgramData\Anaconda\envs\gaussian_splatting\lib\site-packages\pip (python 3.7)
Processing e:\gaussian-splatting\submodules\diff-gaussian-rasterization
  Running command python setup.py egg_info
  running egg_info
  creating C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info
  writing C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\PKG-INFO
  writing dependency_links to C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\dependency_links.txt
  writing top-level names to C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\top_level.txt
  writing manifest file 'C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\SOURCES.txt'
  adding license file 'LICENSE.md'
  writing manifest file 'C:\Users\GAMING~1\AppData\Local\Temp\pip-pip-egg-info-uz_v732m\diff_gaussian_rasterization.egg-info\SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: diff-gaussian-rasterization
  Running command python setup.py bdist_wheel
  running bdist_wheel
  running build
  running build_py
  running build_ext
  error: [WinError 2] The system cannot find the file specified
  error: subprocess-exited-with-error

  × python setup.py bdist_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.
  full command: 'E:\ProgramData\Anaconda\envs\gaussian_splatting\python.exe' -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'E:\\gaussian-splatting\\submodules\\diff-gaussian-rasterization\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\GAMING~1\AppData\Local\Temp\pip-wheel-r46os8o6'
  cwd: E:\gaussian-splatting\submodules\diff-gaussian-rasterization\
  Building wheel for diff-gaussian-rasterization (setup.py) ... error
  ERROR: Failed building wheel for diff-gaussian-rasterization
  Running setup.py clean for diff-gaussian-rasterization
  Running command python setup.py clean
  running clean
  removing 'build\lib.win-amd64-cpython-37' (and everything under it)
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.7' does not exist -- can't clean it
  removing 'build'
Failed to build diff-gaussian-rasterization
Installing collected packages: diff-gaussian-rasterization
  Running command Running setup.py install for diff-gaussian-rasterization
  running install
  E:\ProgramData\Anaconda\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
  !!

          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.

          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************

  !!
    self.initialize_options()
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-37
  creating build\lib.win-amd64-cpython-37\diff_gaussian_rasterization
  copying diff_gaussian_rasterization\__init__.py -> build\lib.win-amd64-cpython-37\diff_gaussian_rasterization
  running build_ext
  error: [WinError 2] The system cannot find the file specified
  error: subprocess-exited-with-error

  × Running setup.py install for diff-gaussian-rasterization 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.
  full command: 'E:\ProgramData\Anaconda\envs\gaussian_splatting\python.exe' -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'E:\\gaussian-splatting\\submodules\\diff-gaussian-rasterization\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' install --record 'C:\Users\GAMING~1\AppData\Local\Temp\pip-record-m972mprs\install-record.txt' --single-version-externally-managed --compile --install-headers 'E:\ProgramData\Anaconda\envs\gaussian_splatting\Include\diff-gaussian-rasterization'
  cwd: E:\gaussian-splatting\submodules\diff-gaussian-rasterization\
  Running setup.py install for diff-gaussian-rasterization ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> diff-gaussian-rasterization

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```
Kosmokleaner commented 1 year ago

I see the same issue.

My local directory is in the gaussian-splatting repro

I run pip install submodules\diff-gaussian-rasterization

from my conda environment

based on the instructions here: https://github.com/jonstephens85/gaussian-splatting-Windows#installing-the-optimizer

the error: image

Does the python version I use cause a problem? I have Python 3.8.17 image image

cl.exe shows the c++ compiler is installed image

I also created a new conda environment and followed the instructions here: https://github.com/jonstephens85/gaussian-splatting-Windows but the same problem happens, just from inside a larger script / build / process. simple-knn fails similarly

image

Kosmokleaner commented 1 year ago

Update: My issue was resolved by installing CUDA 11.8 from here:

https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local

the conda CUDA version seemed to not matter in this case.

I had to close the command line and try again.

I found it by going into gaussian-splatting\submodules\diff-gaussian-rasterization and calling: cmake -Bbuild

The error there: The CUDA Toolkit v11.8 directory '' does not exist. Please verify the CUDA Toolkit is installed properly

Helped me.

RoyDubnium commented 1 year ago

reinstalling cuda did not seem to help in my case. While it did allow for cmake to run without errors, pip still failed to install it.

Cazforshort commented 11 months ago

I can confirm I have the same exact issue

 No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\diff_gaussian_rasterization
      copying diff_gaussian_rasterization\__init__.py -> build\lib.win-amd64-cpython-310\diff_gaussian_rasterization
      running build_ext
      C:\Users\xxx\Programs\miniconda\envs\gau_env\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified

Thats after reinstalling CUDA 11.8 and then trying 11.7 too.

Larthas commented 10 months ago

I can confirm I have the same exact issue

 No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\diff_gaussian_rasterization
      copying diff_gaussian_rasterization\__init__.py -> build\lib.win-amd64-cpython-310\diff_gaussian_rasterization
      running build_ext
      C:\Users\xxx\Programs\miniconda\envs\gau_env\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified

Thats after reinstalling CUDA 11.8 and then trying 11.7 too.

me too

Natalia19892210 commented 8 months ago

You have to restart PC after instalation and it helps.

ertz10 commented 7 months ago

One not so obvious issue I came along was hidden in the cuda environment variable: CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8;' This version constantly failed with the above error message: 'The system cannot find the file specified'

The solution for at least this error message was to remove the semi-colon at the end of the environment path. It was just added because I had multi-lines in the CUDA_HOME variable, which eventually added a semi-colon when clicking 'OK'. So just delete the path again and readd just one line.

GaigeY commented 3 months ago

Hi guys, I can provide another cue to solve your problem. Inspired by @RoyDubnium , I tried to use cmake to install the package, and I successed to address the problem. In my case, there's no cuda toolset found. The problem is raised by the lacking of cuda configure in Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\BuildCustomizations, which can be find in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vxx.x\extras\visual_studio_integration\MSBuildExtensions. You can find more detailed discussion in websites. Hope it would help.


This issue could be solved through copying the cuda files, but some others might meet other problem. In my case, the new error is caused by cofliction between cudatoolkit=11.6 and the real cuda version of my windows system.