threestudio-project / threestudio

A unified framework for 3D content generation.
Apache License 2.0
6.32k stars 480 forks source link

Can't install the requirements! #494

Open sinax11 opened 3 months ago

sinax11 commented 3 months ago

Trying installing the requirements.txt using WSL2, I ran to an issue:

(venv) zetrix@Zetrix:/mnt/d/git/threestudio$ pip install -r requirements.txt
Collecting git+https://github.com/KAIR-BAIR/nerfacc.git@v0.5.2 (from -r requirements.txt (line 5))
  Cloning https://github.com/KAIR-BAIR/nerfacc.git (to revision v0.5.2) to /tmp/pip-req-build-vhdwa66y
  Running command git clone --filter=blob:none --quiet https://github.com/KAIR-BAIR/nerfacc.git /tmp/pip-req-build-vhdwa66y
  Running command git checkout -q d84cdf3afd7dcfc42150e0f0506db58a5ce62812
  Resolved https://github.com/KAIR-BAIR/nerfacc.git to commit d84cdf3afd7dcfc42150e0f0506db58a5ce62812
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-vhdwa66y/setup.py", line 123, in <module>
          ext_modules=get_extensions() if not BUILD_NO_CUDA else [],
        File "/tmp/pip-req-build-vhdwa66y/setup.py", line 29, in get_extensions
          from torch.utils.cpp_extension import CUDAExtension
        File "/mnt/d/git/threestudio/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 25, in <module>
          from pkg_resources import packaging  # type: ignore[attr-defined]
      ImportError: cannot import name 'packaging' from 'pkg_resources' (/mnt/d/git/threestudio/venv/lib/python3.10/site-packages/pkg_resources/__init__.py)
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I checked the txt and I think link of the nerfacc module's link might be broken: git+https://github.com/KAIR-BAIR/nerfacc.git@v0.5.2 It's not a valid URL.

alibalapour commented 3 months ago

I got the similar error. Try this:

pip install setuptools==69.5.1
sinax11 commented 3 months ago

requirements.txt

Didn't work for me ... still getting errs:

zetrix@Zetrix:/mnt/d/git/threestudio$ pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/KAIR-BAIR/nerfacc.git@v0.5.2 (from -r requirements.txt (line 5))
  Cloning https://github.com/KAIR-BAIR/nerfacc.git (to revision v0.5.2) to /tmp/pip-req-build-n01jnbte
  Running command git clone --filter=blob:none --quiet https://github.com/KAIR-BAIR/nerfacc.git /tmp/pip-req-build-n01jnbte
  Running command git checkout -q d84cdf3afd7dcfc42150e0f0506db58a5ce62812
  Resolved https://github.com/KAIR-BAIR/nerfacc.git to commit d84cdf3afd7dcfc42150e0f0506db58a5ce62812
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-n01jnbte/setup.py", line 123, in <module>
          ext_modules=get_extensions() if not BUILD_NO_CUDA else [],
        File "/tmp/pip-req-build-n01jnbte/setup.py", line 27, in get_extensions
          import torch
      ModuleNotFoundError: No module named 'torch'
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.