Skip to content

can't install tiny-cuda-nn in window python environment. #442

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

Closed
kotran88 opened this issue Jun 1, 2024 · 6 comments
Closed

can't install tiny-cuda-nn in window python environment. #442

kotran88 opened this issue Jun 1, 2024 · 6 comments

Comments

@kotran88
Copy link

kotran88 commented Jun 1, 2024

my torch version is

2.1.2+cu118

python version 3.8

and I tried to install tiny-cuda-nn
with command
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

but it cause error saying

Collecting git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
  Cloning https://github.com/NVlabs/tiny-cuda-nn/ to c:\users\pedro\appdata\local\temp\pip-req-build-25iwmcx0
  Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\pedro\AppData\Local\Temp\pip-req-build-25iwmcx0'
  Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 4892659e015b12bd2fce446b8a8e33e646b21746
  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]
      C:\Users\pedro\AppData\Local\Temp\pip-req-build-25iwmcx0\bindings/torch\setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
        from pkg_resources import parse_version
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\pedro\AppData\Local\Temp\pip-req-build-25iwmcx0\bindings/torch\setup.py", line 11, in <module>
          from torch.utils.cpp_extension import BuildExtension, CUDAExtension
        File "C:\Users\pedro\anaconda3\envs\nerf\lib\site-packages\torch\utils\cpp_extension.py", line 28, in <module>
          from pkg_resources import packaging  # type: ignore[attr-defined]
      ImportError: cannot import name 'packaging' from 'pkg_resources' (C:\Users\pedro\anaconda3\envs\nerf\lib\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.

what may be the problem?

@kotran88
Copy link
Author

kotran88 commented Jun 2, 2024

it is same in ubuntu system...

@kotran88 kotran88 closed this as completed Jun 3, 2024
@etam103
Copy link

etam103 commented Jun 4, 2024

@kotran88 Any luck getting this to work?

@utaysi
Copy link

utaysi commented Jun 4, 2024

Also having the same problem.

@finickyDrone
Copy link

finickyDrone commented Jun 5, 2024

Seeing this exact error as well when building inside a Ubuntu 22.04 Docker image:

 > [13/23] RUN python3.10 -m pip install --user --no-cache-dir git+https://github.com/NVlabs/[email protected]#subdirectory=bindings/torch:                                                                    
0.530 Collecting git+https://github.com/NVlabs/[email protected]#subdirectory=bindings/torch                                                                                                                   
0.530   Cloning https://github.com/NVlabs/tiny-cuda-nn.git (to revision v1.6) to /tmp/pip-req-build-ffj71o2f                                                                                                       
0.534   Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn.git /tmp/pip-req-build-ffj71o2f                                                                                
1.678   Running command git checkout -q 8e6e242f36dd197134c9b9275a8e5108a8e3af78                                                                                                                                   
2.129   Resolved https://github.com/NVlabs/tiny-cuda-nn.git to commit 8e6e242f36dd197134c9b9275a8e5108a8e3af78
2.130   Running command git submodule update --init --recursive -q
5.240   Preparing metadata (setup.py): started
6.916   Preparing metadata (setup.py): finished with status 'error'
6.930   error: subprocess-exited-with-error
6.930   
6.930   × python setup.py egg_info did not run successfully.
6.930   │ exit code: 1
6.930   ╰─> [8 lines of output]
6.930       Traceback (most recent call last):
6.930         File "<string>", line 2, in <module>
6.930         File "<pip-setuptools-caller>", line 34, in <module>
6.930         File "/tmp/pip-req-build-ffj71o2f/bindings/torch/setup.py", line 5, in <module>
6.930           from torch.utils.cpp_extension import BuildExtension, CUDAExtension
6.930         File "/home/agarcia/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 25, in <module>
6.930           from pkg_resources import packaging  # type: ignore[attr-defined]
6.930       ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/agarcia/.local/lib/python3.10/site-packages/pkg_resources/__init__.py)
6.930       [end of output]
6.930   
6.930   note: This error originates from a subprocess, and is likely not a problem with pip.
6.933 error: metadata-generation-failed
6.933 
6.933 × Encountered error while generating package metadata.
6.933 ╰─> See above for output.
6.933 
6.933 note: This is an issue with the package mentioned above, not pip.
6.933 hint: See above for details.

So, it seems the new version of setuptools v7.0 introduced some breaking changes. I targeted an earlier version to get things working:
pip install setuptools==69.5.2

@humberthardy
Copy link

For my case, it was a problem regarding setuptools.
python -m pip install setuptools==69 did the work.
Source:
AUTOMATIC1111/stable-diffusion-webui#15863 (comment)

@finickyDrone
Copy link

For my case, it was a problem regarding setuptools. python -m pip install setuptools==69 did the work. Source: AUTOMATIC1111/stable-diffusion-webui#15863 (comment)

Yes, same for me.

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

5 participants